Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

multitime frame, addlinebreak

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    multitime frame, addlinebreak

    for a strategy i want to use multitimeframe strategy.my querry is ::
    to the default instrument on which the strategy is running
    how to add linebreak data series in initialise().when i try following i get no error compliling the startegy but the stratgy wont start qhwn i run it.
    i
    AddLineBreak(Instrument.MasterInstrument.Name, PeriodType.Day, 1, 1, MarketDataType.Last);
    if i use following then i have to change the code every time i change the instrument or rollover period .
    AddLineBreak("FDAX 06-14", PeriodType.Day, 1, 1, MarketDataType.Last);
    .
    is there a way to addlinebreak which will work for all instruments ,pls advise

    #2
    Hello,

    Thank you for the question.

    If you print the Instrument.MasterInstrument.Name this returns only the name of the instrument you are on, not the full name.
    For futures this does not work because the ES 09-14 would just be ES and NinjaTrader does not have a instrument named just ES, it does have an instrument named ES followed by the contract month.

    You would need to change the line to
    Code:
    Instrument.FullName
    OR:

    Code:
    protected override void Initialize()
            {
    	 AddLineBreak(Instrument.FullName, PeriodType.Day, 1, 1, MarketDataType.Last);
                CalculateOnBarClose = true;
            }
            protected override void OnBarUpdate()
            {
    			if (BarsInProgress == 1)
    		{
    			Print(Closes[1][0]); //print the close from the linebreak series only
    		}
       	 }
    Please let me know if I may be of additional assistance.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    648 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    369 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    108 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    572 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    574 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X