Thanks for any help!
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
Looking for help on igh/low plots
Collapse
X
-
Looking for help on igh/low plots
I need to get a plot to go on the low of a bar when it closes higher then previous bar and high of bar when it closes below the low of previous bar.
Thanks for any help!Tags: None
-
Something like:
double DesiredValue = (Close[2]> Close[1] Myplot = Low[2]
Then
= Close[2]<Close[1] Myplot High[2}
-
Thanks for the help PaulH.
I use to code in NT7 yeas ago but am a bit lost now in NT8 and rusty.
Mainly need help with how to program the actual plot. I have the Addplot "Myplot" set up, but not sure the command I need to use.
Comment
-
Hello reedstickets,
Thanks for your post.
I'm not sure but it looks like out posts got out of sequence!
I would suggest using the Ninjascript wizard to create the indicator structure that you need. With the wizard you would supply any inputs needed as well as any plots. By default a plot is has a "Plotstyle" of line type however you can change the plot style to a number of other markers suchas dots, blocks, squares and triangles. The wizard will complete all of the structure for you so all you would need would be to add the OnBarUpDate() logic needed.
An example of the code would be something like:
if (Close[2] > Close[1])
{
myPlot[0] = Low[2];
}
Here is a link to the Ninjascript wizard: https://ninjatrader.com/support/help...?ns_wizard.htm
Paul H.NinjaTrader Customer Service
Comment
-
Thanks for the help,
I got it plotting but my logic is messed up. Is there a way to have the plot:
If (Close[1] > Close[0])
But then a condition for if the close does not close higher then the previous bar [1] or close lower then the Low[1] to not plot a new plot until one of those two events occur?
Thanks for any help, I really need this for my trading.
Comment
-
Hello reedstickets,
Thanks for your reply.
I'm a bit confused by what you are writing.Could you restate for clarity or provide a screenshot of the condition(s) you are looking for?
In terms of syntax, in C# the double ampersand && means a logic "And". The double pips || would be the C# logic "Or".
if (condition_A && (Condition_B || Condition_C))
{
// Do something
}
In the above the code would "Do something" only if A+ B is true, or if A + C is true.
Paul H.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by rocketman7, Today, 02:12 AM
|
7 responses
28 views
0 likes
|
Last Post Today, 09:23 AM | ||
Started by guillembm, Yesterday, 11:25 AM
|
3 responses
16 views
0 likes
|
Last Post Today, 09:11 AM | ||
Started by junkone, 04-21-2024, 07:17 AM
|
10 responses
148 views
0 likes
|
Last Post Today, 09:03 AM | ||
Started by tsantospinto, 04-12-2024, 07:04 PM
|
6 responses
101 views
0 likes
|
Last Post
by tsantospinto
Today, 08:57 AM
|
||
Started by trilliantrader, 04-18-2024, 08:16 AM
|
7 responses
28 views
0 likes
|
Last Post Today, 07:56 AM |
Comment