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 AaronKoRn, Yesterday, 09:49 PM
    0 responses
    11 views
    0 likes
    Last Post AaronKoRn  
    Started by carnitron, Yesterday, 08:42 PM
    0 responses
    10 views
    0 likes
    Last Post carnitron  
    Started by strategist007, Yesterday, 07:51 PM
    0 responses
    12 views
    0 likes
    Last Post strategist007  
    Started by StockTrader88, 03-06-2021, 08:58 AM
    44 responses
    3,982 views
    3 likes
    Last Post jhudas88  
    Started by rbeckmann05, Yesterday, 06:48 PM
    0 responses
    10 views
    0 likes
    Last Post rbeckmann05  
    Working...
    X