NexusFi: Find Your Edge


Home Menu

 





Plot override anchoring problem


Discussion in NinjaTrader

Updated
    1. trending_up 1,594 views
    2. thumb_up 2 thanks given
    3. group 4 followers
    1. forum 4 posts
    2. attach_file 1 attachments




 
Search this Thread

Plot override anchoring problem

  #1 (permalink)
 
gregid's Avatar
 gregid 
Wrocław, Poland
 
Experience: Intermediate
Platform: NinjaTrader, Racket
Trading: Ockham's razor
Posts: 650 since Aug 2009
Thanks Given: 320
Thanks Received: 623

I am working on the indicator (attached) based on some existing ones (eg. TRO_PMSM_Trend). The values are some abstract SMA conditions that are unimportant to the problem with display.

Unfortunately the way it behaves at the moment doesn't make much sense to me. The strange behavior is visible the most when refreshing the chart from the leftmost end. After refresh when you scroll the chart to the right the dots are not anchored to the data (float over chart and remain the same). When scrolling to the left it finally generates new dots (although not anchored to the right bars). Scrolling to the right again it remembers all generated dots until reaching the rightmost point we visited before when it floats again. At no point it anchors the dots correctly

I am out of ideas, please advise.

Here is a screencast (with a link just in case embedding doesn't work)
Anchoring Problem - screencast

Attached Files
Elite Membership required to download: g3SignalDots.zip
Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Futures True Range Report
The Elite Circle
Online prop firm The Funded Trader (TFT) going under?
Traders Hideout
New Micros: Ultra 10-Year & Ultra T-Bond -- Live Now
Treasury Notes and Bonds
NexusFi Journal Challenge - April 2024
Feedback and Announcements
The space time continuum and the dynamics of a financial …
Emini and Emicro Index
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
60 thanks
Funded Trader platforms
37 thanks
NexusFi site changelog and issues/problem reporting
24 thanks
GFIs1 1 DAX trade per day journal
22 thanks
The Program
19 thanks
  #2 (permalink)
 
NinjaTrader's Avatar
 NinjaTrader  NinjaTrader is an official Site Sponsor
Site Sponsor

Web: NinjaTrader
AMA: Ask Me Anything
Webinars: NinjaTrader Webinars
Elite offer: Click here
 
Posts: 1,713 since May 2010
Thanks Given: 203
Thanks Received: 2,686


gregid View Post
I am working on the indicator (attached) based on some existing ones (eg. TRO_PMSM_Trend). The values are some abstract SMA conditions that are unimportant to the problem with display.

Unfortunately the way it behaves at the moment doesn't make much sense to me. The strange behavior is visible the most when refreshing the chart from the leftmost end. After refresh when you scroll the chart to the right the dots are not anchored to the data (float over chart and remain the same). When scrolling to the left it finally generates new dots (although not anchored to the right bars). Scrolling to the right again it remembers all generated dots until reaching the rightmost point we visited before when it floats again. At no point it anchors the dots correctly

I am out of ideas, please advise.

Here is a screencast (with a link just in case embedding doesn't work)
Anchoring Problem - screencast

One my our CSR's sent me this for you to try, if this does not work please follow up in our support forum.

I believe he simply needs to call IsValidPlot like we do in ZigZag to ensure the indicator plot is in sync with the last bar processed. This at least fixed his error scenario on my end…

public override void Plot(Graphics graphics, Rectangle bounds, double min, double max)
{
if (Bars == null || ChartControl == null)
return;

IsValidPlot(Bars.Count - 1 + (CalculateOnBarClose ? -1 : 0)); // make sure indicator is calculated until last (existing) bar

// rest of plot logic...
}

Follow me on Twitter Reply With Quote
Thanked by:
  #3 (permalink)
 
gregid's Avatar
 gregid 
Wrocław, Poland
 
Experience: Intermediate
Platform: NinjaTrader, Racket
Trading: Ockham's razor
Posts: 650 since Aug 2009
Thanks Given: 320
Thanks Received: 623



NinjaTrader View Post
One my our CSR's sent me this for you to try, if this does not work please follow up in our support forum.

I believe he simply needs to call IsValidPlot like we do in ZigZag to ensure the indicator plot is in sync with the last bar processed. This at least fixed his error scenario on my end…

public override void Plot(Graphics graphics, Rectangle bounds, double min, double max)
{
if (Bars == null || ChartControl == null)
return;

IsValidPlot(Bars.Count - 1 + (CalculateOnBarClose ? -1 : 0)); // make sure indicator is calculated until last (existing) bar

// rest of plot logic...
}

Excellent, thank you! This little change makes all the difference - with dots finally anchored I can debug the rest.

Started this thread Reply With Quote
  #4 (permalink)
 drakebauer 
Ramey
 
Experience: Beginner
Platform: NinjaTrader
Broker: None
Trading: ES, YM
Posts: 44 since Aug 2009
Thanks Given: 25
Thanks Received: 15

Does anyone know what this indicator actually measures.

Reason I say that is I don't know what it does but on the right time frames I don't buy or sell unless this indicator is on extremes.

Reply With Quote
  #5 (permalink)
 
gregid's Avatar
 gregid 
Wrocław, Poland
 
Experience: Intermediate
Platform: NinjaTrader, Racket
Trading: Ockham's razor
Posts: 650 since Aug 2009
Thanks Given: 320
Thanks Received: 623


drakebauer View Post
Does anyone know what this indicator actually measures.

Reason I say that is I don't know what it does but on the right time frames I don't buy or sell unless this indicator is on extremes.

That's interesting because I used it only as a shell for development of other indicators and the conditions used were not really designed to do anything specific in terms of trading. But since you've found use for this here is what it does:
It takes SMAs with increasing periods (at dyadic intervals, ie. powers of 2) and if SMA is > Close adds 1 to score if smaller subtracts 1 from score. So the extremes show that most of the SMAs are above or below price. That's it

Started this thread Reply With Quote




Last Updated on November 11, 2015


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts