NexusFi: Find Your Edge


Home Menu

 





Launch sub account strategy in ninjascript


Discussion in NinjaTrader

Updated
    1. trending_up 1,265 views
    2. thumb_up 0 thanks given
    3. group 2 followers
    1. forum 2 posts
    2. attach_file 0 attachments




 
Search this Thread

Launch sub account strategy in ninjascript

  #1 (permalink)
talka
israel tel aviv
 
Posts: 7 since Jan 2015
Thanks Given: 8
Thanks Received: 1

Hello everyone,
I have this issue where my orders are colliding each other (I need to separate my long entry so it won't be used as an exit for my short but as a new entry), therefore I was thinking to use sub accounts.
I was wondering if anyone could help me understand how can I launch a strategy under a sub account.
I have this ninjascript code where you can see that I launch my strategy under my existing account, but I need to enter the sub account information.



MyStrategy childStrategy= new MyStrategy ();
childStrategy.Account = Account;
Period minutePeriod = new Period(PeriodType.Minute,1,MarketDataType.Last);
childStrategy.SetBarsPeriodInstrument(minutePeriod,Position.Instrument);
Strategies.Add(childStrategy);
if (!childStrategy.Enabled)
{
childStrategy.Enabled = true;
}



the line marked in red is the line where i want to replace - instead of using "Account" object i want to use something like "Sub Account".

Thanks!

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Better Renko Gaps
The Elite Circle
REcommedations for programming help
Sierra Chart
About a successful futures trader who didnt know anythin …
Psychology and Money Management
Cheap historycal L1 data for stocks
Stocks and ETFs
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
 
  #3 (permalink)
chrisplecker
Charlottesville, VA
 
Posts: 21 since Apr 2014
Thanks Given: 0
Thanks Received: 13


Being long and short at the same time is virtually the same as being flat. I don't understand what you are trying to do. If you are trading calendar spreads, then you should set the proper instrument. Wanting to go long and short the same instrument is utterly useless and a waste a time. It is no different than going flat.

Reply With Quote




Last Updated on June 11, 2015


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts