//+------------------------------------------------------------------+ //| donforexpersonalizado.mq4 | //| Copyright 2022, MetaQuotes Software Corp. | //| https://www.mql5.com | //+------------------------------------------------------------------+ #property copyright "Copyright 2022, MetaQuotes Software Corp." #property link "https://www.mql5.com" #property version "1.00" #property strict #property indicator_chart_window #property copyright "Copyright 2022, MetaQuotes Software Corp." #property link "https://www.mql4.com" #property version "1.00" #property strict #property indicator_chart_window #property indicator_buffers 2 // #property indicator_plots 2 // #property indicator_label1 "SALE" #property indicator_type1 DRAW_ARROW #property indicator_color1 clrRed #property indicator_style1 STYLE_SOLID #property indicator_width1 1 #property indicator_label2 "PURCHASE" #property indicator_type2 DRAW_ARROW #property indicator_color2 clrDarkGreen #property indicator_style2 STYLE_SOLID #property indicator_width2 1 //LIBRARY ________ //used in data initialization void init ();// //Used to generate incoming paramentros (from the grafico forex gift) double LINES( int region //region number , int type //type of region (0= suport/resistance 1= LTA 2= LTB) , int candle); //candle #import double SALE[]; double PURCHASE[]; extern int MaxBars=5000; extern int SRZBars=1000; extern int Sensitivity=1; extern bool ShowSupResZones=true; extern bool HideSupResPriceLabel=false; extern bool ShowZoneTouches=true; extern color ResistanceLineColor=5737262; extern color SupportLineColor=1993170; extern color HorizontalLineColor=6908265; extern int NormalLinesWidth=1; extern int NormalLineStyle=0; extern int BrokenLineStyle=2; extern int HorizontalLineStyle=2; extern int OverhangBars=15; extern bool Background=false; extern bool MakeGlobalVariables=false; double SER = iCustom(NULL,0,"SUPORT",MaxBars //nome da variavel(dom) ,SRZBars ,Sensitivity ,ShowSupResZones ,HideSupResPriceLabel ,ShowZoneTouches ,ResistanceLineColor ,SupportLineColor ,HorizontalLineColor ,NormalLinesWidth ,NormalLineStyle ,BrokenLineStyle ,HorizontalLineStyle ,OverhangBars ,Background ,MakeGlobalVariables,0);// 0 last candle handle of the grafico //_________________________________________________________________________________________________________ int init()//function of initialization, every time it is loaded on the screen of the grafico, will call this function first { //--- EventSetMillisecondTimer(1000); SetIndexBuffer(0,SALE); SetIndexBuffer(1,PURCHASE); PlotIndexSetInteger(0,PLOT_ARROW,234); SetIndexArrow(0,234); PlotIndexSetInteger(1,PLOT_ARROW,233); SetIndexArrow(1,233); return(INIT_SUCCEEDED); } //_________________________________________________________________________________________________________ // OnCalculate responsible for calculating and bringing the arrow and buffers 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[]) { int limit = 500; //varyable, amount of candle that will go through ArraySetAsSeries(SALE, true); ArraySetAsSeries(PURCHASE,true); if(prev_calculated < 1) { ArrayInitialize(SALE, 0); ArrayInitialize(PURCHASE,0); } else limit++; //Repiticao lacquer for(int i = 0; i >=0; i--) { STRATEGY(i);//strategy i= value of the candle that is traveling } return(rates_total); } // I calculate GENERATING SIGNALS void STRATEGY(int i)// i= VARIAVEL { if //IF THE TOP SHADOW IS GREATER OR EQUAL TO LTB AND IN THE PREVIOUS CANDLE THE TOP SHADOW THAT LTB ( //LTB //[0+1]IF THE MAXIMUM OF THE CURRENT CANDLE IS A 0 AND I AND TO CONNECT IN THE REPEAT LACO, GO THROUGH ALL BARS BRING ALL SIGNALS (int limit = 500;) // >= THE MAXIMA OF THE CURRENT CANDLE IS GREATER OR EQUAL (Lines -0) //(0,2,0+i)- ,0= REGION , 1= LINE LTB , (Low[0+i]<=LINES(0,1,0+i) && Low[1+i]>LINES(0,1,1+i))|| (Low[0+i]<=LINES(1,1,0+i) && Low[1+i]>LINES(1,1,1+i))|| (Low[0+i]<=LINES(2,1,0+i) && Low[1+i]>LINES(2,1,1+i))|| (Low[0+i]<=LINES(3,1,0+i) && Low[1+i]>LINES(3,1,1+i))|| (Low[0+i]<=LINES(4,1,0+i) && Low[1+i]>LINES(4,1,1+i))|| (Low[0+i]<=LINES(5,1,0+i) && Low[1+i]>LINES(5,1,1+i)) ) { SALE[0+i] = High[0+i] + 50* Point; } else { SALE[0+i]=0; } }