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 Mindset, 04-21-2026, 06:46 AM
            0 responses
            87 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by M4ndoo, 04-20-2026, 05:21 PM
            0 responses
            132 views
            0 likes
            Last Post M4ndoo
            by M4ndoo
             
            Started by M4ndoo, 04-19-2026, 05:54 PM
            0 responses
            68 views
            0 likes
            Last Post M4ndoo
            by M4ndoo
             
            Started by cmoran13, 04-16-2026, 01:02 PM
            0 responses
            118 views
            0 likes
            Last Post cmoran13  
            Started by PaulMohn, 04-10-2026, 11:11 AM
            0 responses
            67 views
            0 likes
            Last Post PaulMohn  
            Working...
            X