Thanks for your notes.
There are no documented/supported methods or properties for getting the account that other NinjaScript strategies are enabled on.
You could consider creating user-defined properties that allow you to set the accounts in the Properties section of the Strategies window when enabling the script. Then, use those to loop through <Account>.Positions
See the reference sample on this forum thread demonstrating using a TypeConverter to create user-defined account properties: https://forum.ninjatrader.com/forum/...01#post1175601
TypeConverterAttribute: https://ninjatrader.com/support/help...=typeconverter
The contract date would need to be hard-coded in the strategy each time the instrument changes. Or, you could consider creating a user-defined string property that would allow you to set the instrument name/contract date and then used that variable for if (position.Instrument.FullName == "NQ 06-23") in the script.
For example:
//OnStateChange() State.SetDefaults InstrumentOne = "NQ 06-23"; //OnBarUpdate() if (position.Instrument.FullName == InstrumentOne) //Properties [NinjaScriptProperty] [Display(Name="InstrumentOne", Order=1, GroupName="Parameters")] public string InstrumentOne { get; set; }
Creating User Defined Input Properties: https://ninjatrader.com/support/help...g+user+defined
Comment