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
RSI value at close of bar
Collapse
X
-
RSI value at close of bar
Hi I have a strategy I’m working on. To put a order in 1 tick above the high of a candle close, when the RSI value crosses above the oversold. The issue I’m having is it is reading the RSI last value but it’s not basing it off the close of the candle. How can I get it to only read when the candle closes, to read the value of the RSI? To input the order. ThanksTags: None
-
Hello Hurrikane,
Thanks for your post and welcome to the Ninjatrader forums!
Can you clarify if you are working directly in Ninjascript or are you using the Strategy Builder?
What Calculate mode is the strategy running in? (OnBarClose, OnPriceChange, or OnEachTick)
Are you testing the strategy on live data, marker replay data or in the strategy analyzer with historical data?
Paul H.NinjaTrader Customer Service
-
Hello Hurrikane,
Thanks for your reply.
If you use Calculate.OnBarClose then your strategy code will run one per bar when the bar closes. The values of the RSI would be of the values when the bar closes and would not change.
You could also use Calculate.OnEachTick and use the system bool IsFirstTickOfBar as a trigger to run your coe that only needs to run once per bar.
Reference: https://ninjatrader.com/support/help...ttickofbar.htm
Here is a link to an example that shows this in use: https://ninjatrader.com/support/help...either_cal.htmPaul H.NinjaTrader Customer Service
Comment
-
Hello Hurrikane,
Thanks for your reply.
Calculate.OnBarClose will work in every bar type.
Do you see any errors in the "Log" tab of the control center related to the strategy?
If so that would need to be addressed.
If no errors, can you clarify your comments "...it isn’t reading the OnBarClose.".
Paul H.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by geotrades1, Today, 10:02 AM
|
1 response
4 views
0 likes
|
Last Post Today, 10:19 AM | ||
Started by ender_wiggum, Today, 09:50 AM
|
1 response
5 views
0 likes
|
Last Post Today, 10:10 AM | ||
Started by rajendrasubedi2023, Today, 09:50 AM
|
1 response
11 views
0 likes
|
Last Post Today, 10:05 AM | ||
Started by bmartz, Today, 09:30 AM
|
1 response
9 views
0 likes
|
Last Post Today, 09:48 AM | ||
Started by geddyisodin, Today, 05:20 AM
|
3 responses
26 views
0 likes
|
Last Post Today, 09:36 AM |
Comment