NexusFi: Find Your Edge


Home Menu

 





Launch sub account strategy in ninjascript


Discussion in NinjaTrader

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




 
Search this Thread
  #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?
Iran Airspace Contract Surges to 33.5% as Project Freedo …
Prediction Markets & Event Contracts
Roland Garros Final Day: $3M on Zverev at 80.5% -- Leban …
Prediction Markets & Event Contracts
Hormuz Completely Closed: US Strikes Day 2, Iran Shoots …
Traders Hideout
CME Expands 24/7 Trading to WTI Crude Oil and Gold -- We …
Commodities
Irans Answer Due Today: Peace Surges to 33.5%, Invasion …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
NexusFi site changelog and issues/problem reporting
10 thanks
Darmok and Jalad at Tanagra
3 thanks
Big Mike in Ecuador
1 thanks
30 Sessions
1 thanks
  #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


© 2026 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 - Downloads - Top
no new posts