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 argusthome, 03-08-2026, 10:06 AM
    0 responses
    85 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    48 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    29 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    32 views
    0 likes
    Last Post TheRealMorford  
    Started by Mindset, 02-28-2026, 06:16 AM
    0 responses
    67 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X