I'm using NT7 since a wild and i try to move on NT8 and to transcribe all my scripts.
I'm trying to use sendmail and alert. I configure the smtp gmail as on NT7 and when i launch the test mail, it is working.
I want to specify that i receive data 15 minutes delay from esignal.
I read on your "code breaking changes" page this example for the alert :
protected override void OnBarUpdate()
{
// Generate an alert when the RSI value is greater or equal to 20
if(RSI(14, 3)[0] >= 20)
Alert("myAlert", Priority.High, "Reached threshold", NinjaTrader.Core.Globals.InstallDir+...s\Aler t1.wav", 10,Brushes.Black, Brushes.Yellow);
}
I copy the same code and add this below the Alert line :
SendMail("[email protected]", "test", "test corps email");
My first problem is that when i run the strategy on 2 equities (with the RSI > 20) i do not receive the email and the Alert is not working.
My second problem is that if i change if(RSI(14, 3)[0] >= 20) to if(RSI(14, 3)[1] >= 20), the strategy is not enabling with this logs : Error on calling "OnBarUpdate" method on bar 0 : you are accessing an index with a value that is invalid since it is out-of-range...
I'm sorry to put 2 differents problems of this post but the script is working well on NT7 on the equities strategy. Do i have to specify something specific on OnStateChange ?
Thx for your help.
Comment