Forum on trading, automated trading systems and testing trading strategies
When you post code please use the CODE button (Alt-S)!
#property indicator_label1 "CallSignal" #property indicator_type1 DRAW_ARROW #property indicator_color1 Yellow #property indicator_style1 STYLE_SOLID #property indicator_width1 3 #property indicator_label2 "PutSignal" #property indicator_type2 DRAW_ARROW #property indicator_color2 Yellow #property indicator_style2 STYLE_SOLID #property indicator_width2 3 double CallSignal[], PutSignal[]; string LastTrade = ""; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int OnInit() { //--- indicator buffers mapping SetIndexBuffer(0, CallSignal); SetIndexArrow(0, 217); SetIndexBuffer(1, PutSignal); SetIndexArrow(1, 218); //--- return(INIT_SUCCEEDED); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int OnCalculate(const int rates_total, const int prev_calculated, const datetime &time[], const double &open[], const double &high[], const double &low[], const double &close[], const long &tick_volume[], const long &volume[], const int &spread[]) { //--- for(int i=5000; i >= 0; i--) { if ( Open[i+1]<Close[i+1] && Close[i+1] > iBands(NULL,0,29,2,0,PRICE_CLOSE,MODE_UPPER,i+1) && LastTrade != "CALL") { CallSignal[i] = Low[i]- (35 * Point); LastTrade = "CALL"; } else if ( Open[i+1]>Close[i+1] && Close[i+1] < iBands(NULL,0,29,2,0,PRICE_CLOSE,MODE_LOWER,i+1) && LastTrade != "PUT") { PutSignal[i] = High[i]+ (35 * Point); LastTrade = "PUT"; } //RESET if (Close[i+2] < iBands(NULL,0,29,2,0,PRICE_CLOSE,MODE_MAIN,i+2) && Close[i+1] > iBands(NULL,0,29,2,0,PRICE_CLOSE,MODE_MAIN,i+1)) LastTrade = "PUT"; if (Close[i+2] > iBands(NULL,0,29,2,0,PRICE_CLOSE,MODE_MAIN,i+2) && Close[i+1] < iBands(NULL,0,29,2,0,PRICE_CLOSE,MODE_MAIN,i+1)) LastTrade = "CALL"; } //--- return value of prev_calculated for next call return(rates_total); } //+------------------------------------------------------------------+
- You should have edited your original post; not posted again.
Messages Editor - forreal7: Can someone please help me to add vlines at the same place that the arrows are placed.
Help you with what? You haven't stated a problem, you stated a want. Show us your attempt (using the CODE button) and state the nature of your problem.
No free help 2017.04.21Or pay someone. Top of every page is the link Freelance.
Hiring to write script - General - MQL5 programming forum 2018.05.12We're not going to code it for you (although it could happen if you are lucky or the problem is interesting).
No free help 2017.04.21
Can someone please help me to add vlines at the same place that the arrows are placed.
Wrong. OP has to create a Vline when the arrow buffer gets set. Remember the original question:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Can someone please help me to add vlines at the same place that the arrows are placed.