hi Rosh
i put the indicator level but there is some thing wrong
i put the indicator level but there is some thing wrong
#property indicator_chart_window #property indicator_buffers 2 #property indicator_color1 Aqua #property indicator_color2 Red //////////////////////////////////////////// #property indicator_level1 30 #property indicator_level2 -30 ////////////////////////////////////////// //---- input parameters extern bool enableAlert = false; //---- buffers double buySignal[]; double sellSignal[]; static datetime lastAlertTime; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicators SetIndexStyle(0, DRAW_ARROW); SetIndexStyle(1, DRAW_ARROW); SetIndexBuffer(0, buySignal); SetIndexBuffer(1, sellSignal); SetIndexEmptyValue(0, 0.0); SetIndexEmptyValue(1, 0.0); SetIndexArrow(0, 233); SetIndexArrow(1, 234); //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { for (int i = Bars - IndicatorCounted(); i >= 0; i--) { double a1 = iMA(NULL, 0, 1, 0, MODE_SMA, MODE_SIGNAL,i); double a2 = iHigh(NULL, 0, 0 + i); double a3 = iLow(NULL, 0, 0 + i); //################################################################################ double displacement = GetArrowDisplacement(i); if (a3<-30) { buySignal[i] = Low[i+1] - displacement; if (enableAlert == true && i == 0) SignalAlert("Buy signal On: "); } //***************************************************************************** //***************************************************************************** if (a2>30 ) { sellSignal[i] = High[i+1] + displacement; if (enableAlert == true && i == 0) SignalAlert("Sell signal On: "); } //***************************************************************** //***************************************************************** //***************************************************************** //***************************************************************** //***************************************************************** //***************************************************************** } return(0); }
Sorry, it's impossible. I did mistake.

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
i want to know how can i code the moving levels?