if ( SMA(20)[0] < SMA(20)[1] && SMA(20)[1] > SMA(20)[2] ) DrawArrowUp("UpTrend"+CurrentBar, 0, Low[0] - 5, bullColor);
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
Switching direction
Collapse
X
-
Switching direction
I am trying to set up a notification for when an indicator switches direction. This seems pretty simple but my code isn't working and I'm not great with trouble shooting yet. What am I doing wrong here? Is there an easier way of doing this?
Code:Tags: None
-
Hello BReal,
Could you please reply with your script attached, so that I may investigate this behavior further?
You can attach your strategy to your response by going to File > Utilities > Export NinjaScript > Export selected source files > select your script > select the right arrow > Export. The file will be located under (My) Documents\NinjaTrader 7\bin\Custom\ExportNinjaScript.
You could post the script to your forum reply, or send an email to platformsupport [at] ninjatrader [dot] com with the script as an attachment. In the email please include a link to this forum thread.Shawn B.NinjaTrader Customer Service
-
-
Hello BReal,
You could use CurrentBar to ensure there are enough bars on the chart. Here is an example that checks to make sure you have at least 20 or more bars.
Code:[LEFT] protected override void OnBarUpdate() { if(CurrentBar < 20) return;[/LEFT]
Here is the CurrentBar help guide to assist you further.
Here is a page from our forum on how to Make sure you have enough bars in the data series you are accessing.Shawn B.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by hazylizard, Today, 08:38 AM
|
0 responses
0 views
0 likes
|
Last Post
by hazylizard
Today, 08:38 AM
|
||
Started by Max238, Today, 01:28 AM
|
5 responses
42 views
0 likes
|
Last Post
by Max238
Today, 08:30 AM
|
||
Started by giulyko00, Yesterday, 12:03 PM
|
3 responses
12 views
0 likes
|
Last Post Today, 08:26 AM | ||
Started by habeebft, Today, 07:27 AM
|
1 response
14 views
0 likes
|
Last Post Today, 08:08 AM | ||
Hi
by AveryFlynn
Started by AveryFlynn, Today, 04:57 AM
|
1 response
12 views
0 likes
|
Last Post Today, 07:57 AM |
Comment