Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multiple data series for Range Bars

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

    Multiple data series for Range Bars

    Hallo,

    I have a strategy that runs on a 5min chart. I coded a secondary timeframe of 1 min for exits, and it works just fine.

    Then I apply the strategy to a 10 rangebars chart, and change the code for the secondary timeframe to be 5 rangebar (Add(PeriodType.Range,5). The rest remains the same.

    That does not work. No executions whatsoever.

    Any idea why?

    Thanks
    Juan

    #2
    Hello,

    Thanks for the note.

    Can you please check in the log tab in the control center to make sure the strategy is being enabled?

    I look forward to assisting you further.

    Comment


      #3
      There is nothing unusual in the logs, the strategy is enabled.

      As soon as I remove the 5 rangebar, I see all executions, as soon as I add it, nothing...

      Could it because the chart is 10 range and the second timeframe is smaller?

      Thanks

      Comment


        #4
        Hello,

        Really not sure at this point. Have you tried adding in some Print() statements and checking output to make sure that everything is running as you suspect? Other then that I would need to see the code to get a better idea of whats going on. If you are open to do this let me know I will send instructions on how to send this to me.

        I look forward to assisting you further.

        Comment


          #5
          I did a test on a simpler strategy and get the same behaviour. This is the code for the test strategy:

          protectedoverridevoid Initialize()
          {
          CalculateOnBarClose =
          true;
          Add(EMA(
          1));
          Add(EMA(
          10));
          Add(PeriodType.Range,
          5);
          }

          protectedoverridevoid OnBarUpdate()
          {

          if (BarsInProgress==0)
          {

          if (CrossAbove(EMA(1), EMA(10), 1))
          {
          EnterLong(
          1, "");
          }

          if (CrossBelow(EMA(1), EMA(10), 1))
          {
          EnterShort(
          1, "");
          }

          }
          }

          When applied to a 10 range chart, it shows no executions. As soon as I remove the Add(PeriodType.Range,5); line, it shows them all.

          Any ideas?

          Thanks for the help

          Juan


          Comment


            #6
            Juan, I see no reason why this would not work and can't reproduce it here on a ES 10 Range chart - are you 100% sure the plot executions are enabled in each of your tests? Which NT7 build are you working with here (Help > About to check)?

            Thanks,
            BertrandNinjaTrader Customer Service

            Comment


              #7
              Hallo Bertrand,

              It is quite weird why it does not work. But if I remove the
              Add (PeriodType.Range,5); it works.
              If I add it, it doesn´t.

              I am using the last build.

              I am quite lost and confused and you cannot reproduce.

              Juan


              Comment


                #8
                Print statements!

                Try 2 instead of 10


                Originally posted by jriverac View Post
                I did a test on a simpler strategy and get the same behaviour. This is the code for the test strategy:

                protectedoverridevoid Initialize()
                {
                CalculateOnBarClose =
                true;
                Add(EMA(
                1));
                Add(EMA(
                10));
                Add(PeriodType.Range,
                5);
                }

                protectedoverridevoid OnBarUpdate()
                {

                if (BarsInProgress==0)
                {

                if (CrossAbove(EMA(1), EMA(10), 1))
                {
                EnterLong(
                1, "");
                }

                if (CrossBelow(EMA(1), EMA(10), 1))
                {
                EnterShort(
                1, "");
                }

                }
                }

                When applied to a 10 range chart, it shows no executions. As soon as I remove the Add(PeriodType.Range,5); line, it shows them all.

                Any ideas?

                Thanks for the help

                Juan


                Comment


                  #9
                  Hello,

                  Still works on my side with your test code. Really not sure whats going on at this point. Might be worth while if you email me to support at ninjatrader dot com and reference this forum post and I can setup a remote session where I remote in to your PC.

                  I look forward to assisting you further.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by alifarahani, Today, 09:40 AM
                  6 responses
                  38 views
                  0 likes
                  Last Post alifarahani  
                  Started by Waxavi, Today, 02:10 AM
                  1 response
                  18 views
                  0 likes
                  Last Post NinjaTrader_LuisH  
                  Started by Kaledus, Today, 01:29 PM
                  5 responses
                  15 views
                  0 likes
                  Last Post NinjaTrader_Jesse  
                  Started by Waxavi, Today, 02:00 AM
                  1 response
                  12 views
                  0 likes
                  Last Post NinjaTrader_LuisH  
                  Started by gentlebenthebear, Today, 01:30 AM
                  3 responses
                  17 views
                  0 likes
                  Last Post NinjaTrader_Jesse  
                  Working...
                  X