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 Taddypole, 04-26-2024, 02:47 PM
    1 response
    10 views
    0 likes
    Last Post NinjaTrader_Eduardo  
    Started by futtrader, 04-21-2024, 01:50 AM
    6 responses
    58 views
    0 likes
    Last Post futtrader  
    Started by sgordet, Today, 11:48 AM
    0 responses
    4 views
    0 likes
    Last Post sgordet
    by sgordet
     
    Started by Trader146, Today, 11:41 AM
    0 responses
    5 views
    0 likes
    Last Post Trader146  
    Started by jpapa, 04-23-2024, 07:22 AM
    2 responses
    19 views
    0 likes
    Last Post rene69851  
    Working...
    X