NexusFi: Find Your Edge


Home Menu

 





Limiting Plots from the Past


Discussion in NinjaTrader

Updated
    1. trending_up 79 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:	11
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?
Brendt Skorupinsky
Trading Reviews and Vendors
Quantum physics & Trading dynamics
The Elite Circle
MC PL editor upgrade
MultiCharts
How to plot a custom icon for crossover
NinjaTrader
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
ApexTraderFunding.com experience and review
46 thanks
Tao te Trade: way of the WLD
43 thanks
What is Markets Chat (markets.chat) real-time trading ro …
41 thanks
HumbleTraders next chapter
27 thanks
1 Minute Man
19 thanks
  #2 (permalink)
 
DavidHP's Avatar
 DavidHP 
Isla Mujeres, MX
Legendary Market Wizard
 
Experience: Advanced
Platform: NinjaTrader
Broker: Ninjatrader / Optimus Futures / AmpFutures
Trading: ES / 6E / 6B / CL
Frequency: Every few days
Duration: Minutes
Posts: 1,637 since Aug 2009
Thanks Given: 11,399
Thanks Received: 2,790

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 Twitter Reply With Quote
Thanked by:
  #3 (permalink)
 SamirOfSalem   is a Vendor
 
Posts: 76 since Jan 2020
Thanks Given: 23
Thanks Received: 45



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


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