Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Plots in Market Analyzer window do not reset

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

    Plots in Market Analyzer window do not reset

    I’m using Market Analyzer to run an indicator that can reset its plot. The indicator runs fine in a chart but the same indicator has a problem resetting in the MA. I debugged and I believe the issue may be the way in which the MA checks conditions.

    I attached a screen shot showing the MA overlaid on a chart. In it you can see a few instances of the indicator running in the MA with some plots in green. The MA is overlaid on a chart running the same indicator and you can see that the plots are matching:
    Click image for larger version

Name:	MASignalledOK.png
Views:	219
Size:	16.7 KB
ID:	1086728
    When conditions change the indicator calls Reset(0) on its plots. The plots on the chart disappear as expected but the plots on the MA remain.
    Click image for larger version

Name:	MAStillSignaledNotOk.png
Views:	218
Size:	10.3 KB
ID:	1086729
    I debugged into the indicator code with only the MA indicator running to confirm that the plots had been reset and they had.
    Click image for larger version

Name:	IndicatorPlotIsValidDataPointFalse-Good.png
Views:	222
Size:	17.2 KB
ID:	1086727
    I also noticed that even though the plots had been reset if the current value of the plot is queried a non-zero value is returned.
    Click image for larger version

Name:	IndicatorPlotStillHasData-Hmmm.png
Views:	122
Size:	7.4 KB
ID:	1086730
    I have no control over what this value is. If I set the value to something like 0 and then Reset() the plot do I have any guarantee that the plot value will remain at zero?

    I have the plots in the MA setup with conditions so that they paint different colors and text for various indicator values. The problem is that there is no condition choice available for IsValidDataPoint(0) == false. The only choices are for values.
    Click image for larger version

Name:	MAConditionalPlotChoices-NoIsValidDataPointChoice.png
Views:	248
Size:	22.7 KB
ID:	1086725

    I think the problem could be solved if the MA had a condition option to check for IsValidDataPoint(0) true/false.

    Attached Files

    #2
    Hello Brillo,

    Thanks for your post.

    I have built a simple test indicator with the following code in OnBarUpdate. I am able to fire alerts in an Indicator Market Analyzer Column as I would expect when the value reaches 0. On the chart, the plot is scaling is not adjusted to show 0, and n/a is shown for the plot value in the Data Box as I would expect.

    Code:
    protected override void OnBarUpdate()
    {
        Value[0] = Close[0];
    
        if (CurrentBar % 2 == 0)
        {
            Value[0] = 0;
            Value.Reset(0);
        }
    }
    I believe this setup will allow you to achieve your goal.

    If there are some outstanding issues with this example that you would like to point out, we could make a a case for a feature request in having the Indicator Market Analyzer Column check for IsValidDataPoint.

    I look forward to being of further assistance.
    JimNinjaTrader Customer Service

    Comment


      #3
      Hi Jim. I'm trying your suggestion and I'll let you know how it works out for me.
      As for the feature request I would recommend that it there be an option for IsValidDataPoint. I ran into the issue and it's likely to bother someone else. Also the solution is we have to remember to assign a value to the plot before calling Reset. It's not obvious that the assignment of the value will hold steady after the reset happens. At the very least it should be documented in the help file for the Reset API as a best practice along with explanation.

      Comment


        #4
        Hello Brillo,

        I have submitted a feature request on your behalf. The ID number is SFT-4631.

        This is an internal number, but for anyone else wishing to have their interest tracked, please let our support staff know that you would like a vote added for this request.

        We receive many requests and cannot reasonably implement all requested features or changes. Interest is tracked internally and if enough interest is tracked, it would be weighed against how feasible it would be to make those changes to consider implementing.

        When new features are implemented, they will be listed in the Release Notes page of the Help Guide. The ID number will be different than the internal feature request tracking ID, but the description of the feature will let you know if that feature has been implemented.

        Release Notes - https://ninjatrader.com/support/help...ease_notes.htm

        We look forward to assisting.
        JimNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by XXtrader, Yesterday, 11:30 PM
        2 responses
        11 views
        0 likes
        Last Post XXtrader  
        Started by Waxavi, Today, 02:10 AM
        0 responses
        6 views
        0 likes
        Last Post Waxavi
        by Waxavi
         
        Started by TradeForge, Today, 02:09 AM
        0 responses
        11 views
        0 likes
        Last Post TradeForge  
        Started by Waxavi, Today, 02:00 AM
        0 responses
        2 views
        0 likes
        Last Post Waxavi
        by Waxavi
         
        Started by elirion, Today, 01:36 AM
        0 responses
        7 views
        0 likes
        Last Post elirion
        by elirion
         
        Working...
        X