Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

multiple data series for both time based and price based

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

    multiple data series for both time based and price based

    I want to develop a strategy. The main data series are price based, for example, renko. The second data series are time based, for example, 3 min. If both the condition on renko chart and that on 2 min chart are true, then trigger a trading signal. The code is compiled with error. However, I check the ninjatrader output, the condition on renko chart is always false. Here is the header of OnBarUpdate(). Anything wrong?

    protected override void OnBarUpdate()
    {
    if (BarsInProgress != 0 || BarsInProgress != 1)
    return;

    if (CurrentBars[0] < 1 || CurrentBars[1] <1)
    return;​

    #2
    Hello Playdc,

    Please try changing the first line to the following:

    if(BarsInProgress > 1) return;

    That would allow BIP 0 and 1 to process OnBarUpdate.

    Comment


      #3
      Hi, I followed the instructions. However, it seems the strategy does not update with bars. Is there a template for multiple data series for reference? Thank you.

      Comment


        #4
        Hello Playdc,

        I am not sure what you mean by it does not update with bars, what specifically did you try?

        Comment


          #5
          Hi, I mean there is an indicator based on data series 1. It does not update with bars.

          Comment


            #6
            Hello Playdc,

            Unfortunately I am not sure what you are describing with the terms you are using. When you say it does not update with bars what specifically do you mean? Are you saying the indiators OnBarUpdate method is not being called?

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by CaptainJack, 05-29-2026, 05:09 AM
            0 responses
            169 views
            0 likes
            Last Post CaptainJack  
            Started by CaptainJack, 05-29-2026, 12:02 AM
            0 responses
            88 views
            0 likes
            Last Post CaptainJack  
            Started by charlesugo_1, 05-26-2026, 05:03 PM
            0 responses
            128 views
            0 likes
            Last Post charlesugo_1  
            Started by DannyP96, 05-18-2026, 02:38 PM
            1 response
            208 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by CarlTrading, 05-11-2026, 05:56 AM
            0 responses
            185 views
            0 likes
            Last Post CarlTrading  
            Working...
            X