Is there a simple way to, lets say for example, set up a 1-minute 12-period SMA crossing over a 5-minute, 20-period SMA?
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
How to Set Up an Alert on 2 Different Timeframes
Collapse
X
-
How to Set Up an Alert on 2 Different Timeframes
Hello,
Is there a simple way to, lets say for example, set up a 1-minute 12-period SMA crossing over a 5-minute, 20-period SMA?Tags: None
-
Just to add, I just realized I posted on the "Ninjatrader 7/Indicator Development". Just to let you know, this is for Ninjatrader 8. Sorry about that.
-
Hello RookieTrader,
Thanks for your post.
I have moved the forum thread to the NinjaTrader Desktop Indicator Development section of the Forums since you mentioned this inquiry is about NinjaTrader 8, not NinjaTrader 7.
To have an indicator calculate values based on a secondary data series, you could add the secondary data series to the script by using the AddDataSeries() method.
Then, you could specify the BarsArray of the series you want to use when calling the indicator.
For example, SMA(BarsArray[1], 20)[0] would be used to have the SMA indicator calculate values based on the first added series in a NinjaScript.
Whereas SMA(12)[0] would mean the SMA indicator is calculating using the primary series the script is running on.
You could create your condition comparing the two SMA values and then call Alert() within your condition.
See the help guide documentation below for more information.
SMA: https://ninjatrader.com/support/help...simple_sma.htm
AddDataSeries: https://ninjatrader.com/support/help...dataseries.htm
BarsArray: https://ninjatrader.com/support/help.../barsarray.htm
Multi-Timeframe/Multi-Series NinjaScripts: https://ninjatrader.com/support/help...nstruments.htm
Alert: https://ninjatrader.com/support/help.../nt8/alert.htmBrandon H.NinjaTrader Customer Service
Comment
-
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by fx.practic, 10-15-2013, 12:53 AM
|
5 responses
5,404 views
0 likes
|
Last Post
by Bidder
Today, 12:22 AM
|
||
Started by Shai Samuel, 07-02-2022, 02:46 PM
|
4 responses
95 views
0 likes
|
Last Post
by Bidder
Today, 12:11 AM
|
||
Started by DJ888, Yesterday, 10:57 PM
|
0 responses
8 views
0 likes
|
Last Post
by DJ888
Yesterday, 10:57 PM
|
||
Started by MacDad, 02-25-2024, 11:48 PM
|
7 responses
160 views
0 likes
|
Last Post Yesterday, 10:23 PM | ||
Started by Belfortbucks, Yesterday, 09:29 PM
|
0 responses
9 views
0 likes
|
Last Post
by Belfortbucks
Yesterday, 09:29 PM
|
Comment