thanks for your time.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Strategy Help
Collapse
X
-
Strategy Help
Can someone tell me how to make reference to a peak or dip in an RSI value in a strategy?
thanks for your time.Tags: None
-
safetrading,
That is tricky. You need to objectively set out and define what a peak is and what a valley is. When you come up with objective rules then you can program it with the Strategy Wizard. It would just be a matter of comparing prior bar's values with the next bar's value to determine if it is up or down.Josh P.NinjaTrader Customer Service
-
Thanks for the reply. I understand how to reference different values from one bar to the next to create a peak or dip, but what I don't understand is how to refernece that in time. For example, I could say a peak made by the preceding bar being less than the current bar, and next bar is also less than the current bar.
Now we have a peak, but how do I reference that point in time whether is is one bar ago, or 5 bars ago?
Originally posted by NinjaTrader_Josh View Postsafetrading,
That is tricky. You need to objectively set out and define what a peak is and what a valley is. When you come up with objective rules then you can program it with the Strategy Wizard. It would just be a matter of comparing prior bar's values with the next bar's value to determine if it is up or down.
Comment
-
From programming you can set yourself a variable that records what bar the peak was formed and then you can just access this variable whenever you need it.
Now you know which bar it occured on. If you wanted to access the price of this bar in the future you can now do something like this:Code:if (....... peak logic) peakOccurence = CurrentBar;
Code:Close[CurrentBar - peakOccurence]
Josh P.NinjaTrader Customer Service
Comment
-
Thanks, I'll give it a try.
Originally posted by NinjaTrader_Josh View PostFrom programming you can set yourself a variable that records what bar the peak was formed and then you can just access this variable whenever you need it.
Now you know which bar it occured on. If you wanted to access the price of this bar in the future you can now do something like this:Code:if (....... peak logic) peakOccurence = CurrentBar;
Code:Close[CurrentBar - peakOccurence]
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
633 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
364 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
105 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
567 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
568 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment