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 DJ888, 04-16-2024, 06:09 PM
    6 responses
    18 views
    0 likes
    Last Post DJ888
    by DJ888
     
    Started by Jon17, Today, 04:33 PM
    0 responses
    1 view
    0 likes
    Last Post Jon17
    by Jon17
     
    Started by Javierw.ok, Today, 04:12 PM
    0 responses
    6 views
    0 likes
    Last Post Javierw.ok  
    Started by timmbbo, Today, 08:59 AM
    2 responses
    10 views
    0 likes
    Last Post bltdavid  
    Started by alifarahani, Today, 09:40 AM
    6 responses
    41 views
    0 likes
    Last Post alifarahani  
    Working...
    X