unclelou
09-22-2009, 08:49 PM
I've been using the indicator BB_Squeeze_Alert which sounds an alert when coming out of the squeeze (red to green dot). I would like the alert to sound when going into the squeeze (green to red dot). Could someone help me as I don't know how to program? I've attached the file. Thanks.
NinjaTrader_Bertrand
09-23-2009, 02:13 AM
unclelou, as a last resort you can contact a NinjaScript consultant from the link below to work those modifications in for you - http://www.ninjatrader.com/webnew/partners_onlinetrading_NinjaScript.htm
MicroAl
09-23-2009, 02:30 AM
Hi
Looking at the code in the indicator I believe the relevant section is below
if(BBhigh <= KChigh || BBlow >= KClow)
{
DrawDot(barcounter.ToString(),0,0,SqueezeColor);
Signal.Set(1);
}
if(BBhigh > KChigh || BBlow < KClow)
{
DrawDot(barcounter.ToString(),0,0,ActionColor);
Signal.Set(-1);
}
// Generates an alert on signal change...
if(Signal.Get(CurrentBar - 1) == 1 && Signal.Get(CurrentBar) == -1) {
I believe that all you have to do is to change the == 1 and == -1 in the last line to == -1 and == 1 to achieve what you want. Open the file in the Ninja script editor and then save it with a new name eg BBSqueezeAlertMod. Then try changing the above. Press F5 to compile and all should be well If no one else comes back you I will look at this later today when I have access to Ninja.
May I suggest that you look at the examples in the user guide on custom indicators lessons. You may not wish to learn C# programming in total but amending other peoples scripts to do what you want is in most cases relatively simple!