NexusFi: Find Your Edge


Home Menu

 





Limiting Plots from the Past


Discussion in NinjaTrader

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




 
Search this Thread
  #1 (permalink)
 zeller4 
Orlando Florida
 
Experience: Intermediate
Platform: NT8
Trading: CL, NQ, ES, RTY
Posts: 478 since Jun 2009
Thanks Given: 1,419
Thanks Received: 404

Good Evening,
I'm trying to Plot Dots on the current 4 or 5 Bars but eliminate them from the left edge of the chart. As each new bar plots, I want the plotted new dot but the plots beyond a certain index (ie [4]) and all the way to the left edge of the chart to be a double.MinValue.

[CODE]
int fromHereOn = (Bars.Count-5);
int fromHereOn2 = (CurrentBar - fromHereOn);

if (CurrentBar >= fromHereOn)
MAPlot3[0] = Median[0];
else
if (fromHereOn2 >= 4)
{
MAPlot3[0] = double.MinValue;
PlotBrushes[1][0] = Brushes.Transparent;
}

Any help making this work would be much appreciated.
kz


Attached Thumbnails
Click image for larger version

Name:	Screenshot 2024-06-21 211459.png
Views:	94
Size:	11.6 KB
ID:	340495  
Attached Files
Elite Membership required to download: SMAv00.cs
Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Thanks Mike. Godspeed.
The Elite Circle
Warsh Drops Easing Bias, December Hike Now Above 50% -- …
Prediction Markets & Event Contracts
Datafeed for Atas
Platforms and Indicators
Netherlands & Germany Surge as World Cup Field Narro …
Prediction Markets & Event Contracts
Iran Lebanon Problem Kills Switzerland Talks, Brent at $ …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Want your NinjaTrader indicator created, free?
5 thanks
Afternoon-close session
1 thanks
Franks Trading Journey
1 thanks
Denied 20K payouts: Alpha Futures
1 thanks
FootPrintV2 Chart for NT8
1 thanks
  #2 (permalink)
 
DavidHP's Avatar
 DavidHP 
Isla Mujeres, MX
Legendary Market Wizard
 
Experience: Advanced
Platform: NinjaTrader
Broker: Ninjatrader / Optimus Futures / AmpFutures
Trading: NQ / ES / 6E / 6B / CL
Frequency: Every few days
Duration: Minutes
Posts: 1,825 since Aug 2009
Thanks Given: 11,784
Thanks Received: 3,051

Other ways exist but this one works and comes in NT8.

This way is coded in an NT8 indicator called 'TrendLines"
It has a way to limit the number of trendlines but can be adapted for other things.

Check the code out and follow:
NumberOfTrendLines & Enqueue




zeller4 View Post
Good Evening,
I'm trying to Plot Dots on the current 4 or 5 Bars but eliminate them from the left edge of the chart. As each new bar plots, I want the plotted new dot but the plots beyond a certain index (ie [4]) and all the way to the left edge of the chart to be a double.MinValue.

Any help making this work would be much appreciated.
kz


Rejoice in the Thunderstorms of Life . . .
Knowing it's not about Clouds or Wind. . .
But Learning to Dance in the Rain ! ! !
Follow me on X Reply With Quote
Thanked by:
  #3 (permalink)
 SamirOfSalem   is a Vendor
 
Posts: 77 since Jan 2020
Thanks Given: 23
Thanks Received: 49



zeller4 View Post
Good Evening,
I'm trying to Plot Dots on the current 4 or 5 Bars but eliminate them from the left edge of the chart. As each new bar plots, I want the plotted new dot but the plots beyond a certain index (ie [4]) and all the way to the left edge of the chart to be a double.MinValue.

[CODE]
int fromHereOn = (Bars.Count-5);
int fromHereOn2 = (CurrentBar - fromHereOn);

if (CurrentBar >= fromHereOn)
MAPlot3[0] = Median[0];
else
if (fromHereOn2 >= 4)
{
MAPlot3[0] = double.MinValue;
PlotBrushes[1][0] = Brushes.Transparent;
}

Any help making this work would be much appreciated.
kz

Instead of setting a plot's brush to transparent, consider using .Reset() or .Reset(x)
https://ninjatrader.com/support/helpGuides/nt8/NT%20HelpGuide%20English.html?reset.htm

For example, when a new bar comes in or closes, Reset the Plot in question at 5+1, that way you keep the last 5 and the one slot before them gets reset so it won't plot.

I hope this helps.


Reply With Quote
Thanked by:




Last Updated on June 23, 2024


© 2026 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 - Downloads - Top
no new posts