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 NullPointStrategies, Today, 05:17 AM
            0 responses
            25 views
            0 likes
            Last Post NullPointStrategies  
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            121 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            64 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            41 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            46 views
            0 likes
            Last Post TheRealMorford  
            Working...
            X