• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy "Centre on price" error

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

    Strategy "Centre on price" error

    Attached are 4 charts in 2 screenshots set with 6E 61 renko.
    The left chart on each screenshot is set with "Centre price on scale" and the right one set without "Centre price on scale"
    When the strategy is running, it for whatever reason, automatically enters and exits positions based on the "Centre price on scale" setting as can be seen from the left chart on each screenshot.
    When you compare the 2 identical charts, my custom indicator, which is loaded into the strategy, shows where the close/buy SHOULD have been made as that is where the crossover happened on the chart (as you can see with the left chart the indicator is not aligned properly because the "centre price on scale" must be automatically loaded into the strategy settings.
    Only 31 bars later did the Strategy execute the close/buy.

    Whether i disable or enable the "Centre price on scale" in the Data series, the strategy does exactly the same thing.
    So my question; how do I stop the strategy from doing this?
    At point of exit/entry

    #2
    Hello TrendFollowingCapital,

    Thank you for your post.

    If I understand correctly, you're saying the Center on Price scale is changing the way his line interacts with the price. but the executions on each chart are the same. What is your strategy's entry conditions? Using Print statements when the strategy hits the condition will help to confirm that the strategy is executing orders on the same values no matter if Center on price scale is on or off, because Center on Price Scale doesn't change the behavior of a strategy - so if it is changing somehow, we need to know where.

    Prints from your strategy that will show in the NinjaScript Output window, with information on what the variables you're using for your conditions are on a particular bar, can be very helpful in confirming this.

    This forum post goes into great detail on how to use prints to help figure out whether your strategy is indeed operating the same way on both charts — this should get you going in the correct direction. You can even add these using the Strategy Builder.
    https://ninjatrader.com/support/foru...ns-not-working

    If you run into issues like you're seeing here, the above information will allow you to print out all values used in the condition in question that may be evaluating differently. With the printout information you can assess what is different between the two.

    Also, here is a link to a forum post that goes into comparing real time, backtest, and historical performance of a strategy:
    https://ninjatrader.com/support/foru...ay-performance

    Please let us know if we may be of further assistance to you.
    Kate W.NinjaTrader Customer Service

    Comment


      #3
      Hi Kate

      Thank you for your reply, yes I am well aware that the "Centre on Price scale" in the data series properties does not change the behaviour of the Strategy and that is exactly my point, the Strategy is automatically centering the indicator to the price movements, i disabled "centre on price scale" on the 2nd chart in each screenshot to show you how, on the left the strategy running and taking positions, and on the right how it should be running without the indicator being centred to the price. However visually i change the look of the chart, the strategy is still executing positions based on everything being centred.

      The point i am trying to make is that the Strategy infrastructure is manipilating the indicator in a way it shoulod not be, it is taking the indicator, squeezing it into alignment instead of letting it plot how it was meant to be plotted and letting the indicator give its signals. I will be more than happy to make a video to show you how the strategy builder is ruining the accuracy of the indicator itself if that will help?

      Comment


        #4
        Hello TrendFollowingCapital,

        Thank you for your reply.

        We can only offer limited troubleshooting for third party indicators and add-ons. We'll need you to reproduce these behaviors in a strategy using only built-in indicators and drawing tools for us to test. If you can reproduce this behavior with only built-in indicators, we would be able to test this. The issue is that we don't usually even have access to a third party vendor's code and thus would not be able to test or do anything other than let the vendor know there's a problem. You've got quite a bit going on your charts and we would need to narrow this down to isolate behavior.

        Keep in mind that rendering != the actual data from the indicator. Center on Price Scale simply changes how the indicator is displayed, not any of its values. As these are third party scripts, we cannot guarantee how well they will work with any particular feature available in the platform. It's very possible that the indicator you're using isn't set up correctly to adapt to center on price.

        However, if you can reproduce this behavior with stock indicators, I would be happy to take a look.

        Please let us know if we may be of further assistance to you.
        Kate W.NinjaTrader Customer Service

        Comment


          #5
          Hi Kate, this is indeed a default setting with Strategies and I may have found the solution on this support thread, I just hope this is for Ninjatrader 8:
          https://ninjatrader.com/support/foru...scale-property


          This is what the solution looks like:

          You can set the plots of your NinjaScript to draw with AutoScale disabled by setting IsAutoScale to false inside OnStateChange() when the State is State.SetDefaults.

          Please consider the sample code from the help documentation:

          Code:
          protected override void OnStateChange() { if (State == State.SetDefaults) { Name = "Example Indicator"; // set this to true to call CalculateMinMix() to ensure drawing tool is fully rendered in chart scale IsAutoScale = true; } else if (State == State.Configure) { } }
          https://ninjatrader.com/support/help...sautoscale.htm
          This code will set all of the plots to AutoScale. If we set IsAutoScale to false, the plots will not be set to draw with AutoScale.

          Drawing objects that you are adding from your indicator or strategy will have to use the isAutoScale argument of the Drawing Object's calling method.
          Last edited by TrendFollowingCapital; 05-17-2019, 11:06 PM.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by roblogic, Yesterday, 04:06 AM
          1 response
          9 views
          0 likes
          Last Post koganam
          by koganam
           
          Started by nepenthean, Today, 08:01 AM
          0 responses
          6 views
          0 likes
          Last Post nepenthean  
          Started by bxl2019, Today, 07:59 AM
          0 responses
          3 views
          0 likes
          Last Post bxl2019
          by bxl2019
           
          Started by tcfcigvo, Yesterday, 11:39 PM
          0 responses
          8 views
          0 likes
          Last Post tcfcigvo  
          Started by BobbyWan, Yesterday, 09:15 PM
          0 responses
          11 views
          0 likes
          Last Post BobbyWan  
          Working...
          X