protected override void Initialize() { CalculateOnBarClose = false; } /// <summary> /// Called on each bar update event (incoming tick) /// </summary> protected override void OnBarUpdate() { // Condition set 1 Print("EMA50-"+EMA(50)[0]+" EMA100-"+EMA(100)[0]+" STOC-"+Stochastics(5, 3, 3).K); if (EMA(50)[0] > EMA(100)[0] && CrossAbove(GetCurrentAsk(), EMA(50), 5) && CrossAbove(Stochastics(5, 3, 3).K, 20, 5)) { Alert("MyAlert0", Priority.High, "Buy Long Signal", @"C:\Program Files (x86)\NinjaTrader 7\sounds\Alert1.wav", 5, Color.White, Color.Black); } if (EMA(50)[0] < EMA(100)[0] && CrossBelow(GetCurrentBid(), EMA(50), 5) && CrossBelow(Stochastics(5, 3, 3).K, 80, 5)) { Alert("MyAlert0", Priority.High, "Buy Short Signal", @"C:\Program Files (x86)\NinjaTrader 7\sounds\Alert1.wav", 5, Color.White, Color.Black); } }
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
Alerts using a Strategy in a Chart
Collapse
X
-
Alerts using a Strategy in a Chart
I have a very simple strategy that tests 2 emas and a Stochastic, and having sat and watched the output scroll past for the last couple of hours, I can see several occasions that I think it should have alerted me, but it hasn't. My guess is that been new to Ninja Script I've made a simple error, but I'm damned if I can find it. I've enclosed the code below, can anybody tell me what I've done wrong.
Code:Tags: None
-
Hello,
Thank you for the question.
I will try and run this, could you provide details on the instrument and chart settings that this works on?
Also can you provide a sample of the output where you see it should have been triggered?
I look forward to being of further assistance.JesseNinjaTrader Customer Service
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