How can I edit the standard indicator to do this?
Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
Parabolic SAR Diaplay Only 1st Dot
Collapse
X
-
Parabolic SAR Diaplay Only 1st Dot
I am trying to ONLY display the first plot when the Parabolic SAR crosses price like the image attached.
How can I edit the standard indicator to do this?
1 PhotoTags: None
-
Hello jonbennett,
Thank you for your post.
If you only want to display the first plot when the Parabolic SAR reverses, you could change this within OnStateChange:
AddPlot(new Stroke(Brushes.Goldenrod, 2), PlotStyle.Dot, NinjaTrader.Custom.Resource.NinjaScriptIndicatorNa meParabolicSAR);
to this:
AddPlot(new Stroke(Brushes.Transparent, 2), PlotStyle.Dot, NinjaTrader.Custom.Resource.NinjaScriptIndicatorNa meParabolicSAR);
Then, within OnBarUpdate, you could modify this section adding something like this (you can pick whatever color you like, I just used red for this example):
// Reverse position
if ((longPosition && (Low[0] < todaySAR || Low[1] < todaySAR))
|| (!longPosition && (High[0] > todaySAR || High[1] > todaySAR)))
{
Value[0] = Reverse();
PlotBrushes[0][0] = Brushes.Red;
}
You'll need to save this as a custom indicator, but it should look like this when you're done and apply it to a chart:
Please let us know if we may be of further assistance to you.Kate W.NinjaTrader Customer Service
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by johntraderuser2, Today, 02:34 AM
|
0 responses
6 views
0 likes
|
Last Post Today, 02:34 AM | ||
Started by IanS00, 03-27-2024, 11:24 AM
|
2 responses
12 views
0 likes
|
Last Post Today, 02:00 AM | ||
Started by Mariawilcoxi, Today, 01:32 AM
|
0 responses
4 views
0 likes
|
Last Post
by Mariawilcoxi
Today, 01:32 AM
|
||
Started by gleichnerany, Today, 01:17 AM
|
0 responses
5 views
0 likes
|
Last Post
by gleichnerany
Today, 01:17 AM
|
||
Started by WHICKED, 03-27-2024, 12:33 PM
|
4 responses
47 views
0 likes
|
Last Post Today, 12:28 AM |
Comment