Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Output window for 1 strategy running twice

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

    Output window for 1 strategy running twice

    Hi there

    I am running the same strategy in the "Strategies" tab on two different timeframes.

    How do I get the output window for 1 timeframe over the other?

    I am trying to debug one timeframe and not the other.

    Thx
    IJ

    #2
    ij001,

    You can separate logic by using BarsInProgress. For example, the chart timeframe would be BarsInProgress == 0, the second data series would be BarsInProgress == 1, etc.

    If you are submitting orders on each time frame, I would suggest printing to the output window the BarsInProgress to identify which order came from which time frame.

    Here is an example :

    Code:
    private override void OnBarUpdate()
    {
    
    if(BarsInProgress == 0)  //we are on the chart timeframe
    {
        Print("BarsInProgress is : "+BarsInProgress.ToString());
    
       // other code here
    }
    else if(BarsInProgress == 1)  //we are on the second timeframe
    {
        Print("BarsInProgress is : "+BarsInProgress.ToString());
    
       // other code here
    }
    
    //other code here
    
    }
    Adam P.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    84 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    47 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    66 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    69 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    58 views
    0 likes
    Last Post CarlTrading  
    Working...
    X