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.
    JesseNinjaTrader Customer Service

    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?
        JesseNinjaTrader Customer Service

        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?
            JesseNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by yubo27, 12-01-2023, 09:32 AM
            10 responses
            260 views
            0 likes
            Last Post judysamnt7  
            Started by thehammer, 12-18-2023, 08:51 PM
            10 responses
            250 views
            0 likes
            Last Post judysamnt7  
            Started by Rosa Riley, Today, 05:44 AM
            0 responses
            10 views
            0 likes
            Last Post Rosa Riley  
            Started by giogio1, 12-01-2024, 08:49 PM
            4 responses
            20 views
            0 likes
            Last Post giogio1
            by giogio1
             
            Started by rokups, 12-01-2024, 05:44 AM
            2 responses
            25 views
            0 likes
            Last Post rokups
            by rokups
             
            Working...
            X