Adding this function to the F2 (Insert Snippet) Menu:
#region BOOL SWITCHES:
#region SCOPE: (State == State.SetDefaults) ACTION BLOCK
#region Bars Sounds Bool Switches
HSoundSwitch = true;
IHSounsSwitch = true;
#endregion
#endregion
#region SCOPE: OnBarUpdate() ACTION BLOCK
#region SUB-SCOPE : <YOUR MAIN CONDITION(s) STATEMENT>
if ( <YOUR MAIN CONDITION(s) STATEMENT>
&& (doOnce == false) )
{
if(HSoundSwitch)
{
PlaySound(@"C:\Program Files\NinjaTrader 8\sounds\" + SoundFilesHBrush);
doOnce = true; // prevent additional alerts
}
}
#endregion
#region SUB-SCOPE : <YOUR MAIN CONDITION(s) STATEMENT>
else if ( <YOUR REVERSE MAIN CONDITION(s) STATEMENT>
&& (doOnce == false) )
{
if(IHSounsSwitch)
{
PlaySound(@"C:\Program Files\NinjaTrader 8\sounds\" + SoundFilesIHBrush);
doOnce = true; // prevent additional alerts
}
}
#endregion
#endregion

Comment