The words you are searching are inside this book. To get more targeted content, please make full-text search by clicking here.
Discover the best professional documents and content resources in AnyFlip Document Base.
Search
Published by gilvitoriano007, 2023-10-12 12:40:14

sodapdf-converted

sodapdf-converted

//===================================================================== ====================================================================== ================= if(ativar_TOPWIN) { string carregando = "Enviando Sinal Pro TOPWIN..."; CreateTextLable("carregando1",carregando,10,"Verdana",clrLavender,2,10,5); } //===================================================================== ====================================================================== ================= if(ativar_mx2) { string carregando = "Conectado... Enviando Sinal Pro MX2 TRADING...!"; CreateTextLable("carregando1",carregando,10,"Andalus",clrLavender,2,0,0); } //===================================================================== ====================================================================== ================= if(ativar_mamba) { string carregando = "Conectado... Enviando Sinal Pro MAMBA...!"; CreateTextLable("carregando1",carregando,10,"Andalus",clrLavender,2,0,0); } //===================================================================== ====================================================================== ================= if(ativar_pricepro) { string carregando = "Conectado... Enviando Sinal Pro PRICEPRO..."; CreateTextLable("carregando1",carregando,10,"Andalus",clrLavender,2,0,0); } //===================================================================== ====================================================================== ================= if(FiltroDeNoticias) { string carregando = "Ativo... Filtro De Noticias..."; CreateTextLable("carregando2",carregando,11,"Time New Roman",clrGold,0,5,25); } //===================================================================== ====================================================================== ================= { //Contato Taurus string carregando = "|| Me chame no telegram para renovar: @IndicadoresTaurus ||"; CreateTextLable("carregandoLabel",carregando,12,"Andalus",clrLavender,3,0,0); }


} //===================================================================== ====================================================================== ================= bool DonForex(int j, bool trendUp) { for(int i=0; i<ObjectsTotal(); i++) { if(ObjectType(ObjectName(i))==OBJ_RECTANGLE && StringFind(ObjectName(i),"PERFZONES_SRZ",0)!=-1) { double value_min = ObjectGetDouble(0, ObjectName(i), OBJPROP_PRICE1); double value_max = ObjectGetDouble(0, ObjectName(i), OBJPROP_PRICE2); string rectangle_size = DoubleToStr((value_max-value_min)/Point,0); if(trendUp && Low[j] < value_max && Open[j] > value_max && StrToInteger(rectangle_size)>min_size_donforex) return true; else if(!trendUp && High[j] > value_min && Open[j] < value_min && StrToInteger(rectangle_size)>min_size_donforex) return true; } } return false; } //===================================================================== ====================================================================== ================= void ClearScreen() { for(int i=0; i<ObjectsTotal(); i++) { //Print(ObjectName(i)); if(StringFind(ObjectName(i),"PERFZONES_SRZHL",0)!=-1 || StringFind(ObjectName(i),"PERFZONES_SRZTT",0)!=-1 || StringFind(ObjectName(i),"PERFZONES_Name",0)!=-1 || StringFind(ObjectName(i),"PERFZONES_SRZD",0)!=-1 || StringFind(ObjectName(i),"PERFZONES_SRZTRL",0)!=-1 ) { ObjectDelete(0,ObjectName(i)); } } } //===================================================================== ====================================================================== =================


bool sinal_buffer(double value) { if(value != 0 && value != EMPTY_VALUE) return true; else return false; } //===================================================================== ====================================================================== ================= string PeriodString() { switch(_Period) { case PERIOD_M1: return("M1"); case PERIOD_M5: return("M5"); case PERIOD_M15: return("M15"); case PERIOD_M30: return("M30"); case PERIOD_H1: return("H1"); case PERIOD_H4: return("H4"); case PERIOD_D1: return("D1"); case PERIOD_W1: return("W1"); case PERIOD_MN1: return("MN1"); } return("M" + string(_Period)); } //===================================================================== ====================================================================== ================= //CALCULO VOLUE CHART void computes_value_charte(int bars, int period) { double sum; double floatingAxis; double volatilityUnit; for(int i = bars-1; i >= 0; i--) { datetime t = Time[i]; int y = iBarShift(NULL, period, t);


int z = iBarShift(NULL, 0, iTime(NULL, period, y)); /* Determination of the floating axis */ sum = 0; for(int k = y; k < y+VC_NumBars; k++) { sum += (iHigh(NULL, period, k) + iLow(NULL, period, k)) / 2.0; } floatingAxis = sum / VC_NumBars; sum = 0; for(int k = y; k < VC_NumBars + y; k++) { sum += iHigh(NULL, period, k) - iLow(NULL, period, k); } volatilityUnit = 0.2 * (sum / VC_NumBars); /* Determination of relative high, low, open and close values */ vcPut[i] = (iHigh(NULL, period, y) - floatingAxis) / volatilityUnit; vcCall[i] = (iLow(NULL, period, y) - floatingAxis) / volatilityUnit; } } //===================================================================== ====================================================================== ================= bool horizontal(int vela, string posicao) { int total_ser = 1; if(SeR) { int obj_total=ObjectsTotal(); for(int A=0; A<obj_total; A++) { string name=ObjectName(A); int objectType = ObjectType(name); double p2; if(objectType == OBJ_HLINE) { p2 = ObjectGet(name, OBJPROP_PRICE1); if(Open[vela] < MarketInfo(Symbol(), MODE_BID) && Open[vela] < p2 && High[vela] >= p2) { if(total_ser >= MinSeR ) { if(posicao == "down") { return true; }


} total_ser++; } if(Open[vela] > MarketInfo(Symbol(), MODE_BID) && Open[vela] > p2 && Low[vela] <= p2) { if(total_ser >= MinSeR ) { if(posicao == "up") { return true; } } total_ser++; } } } } else { return true; } return false; } //===================================================================== ====================================================================== ================= //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ bool sequencia_minima(string direcao, int vela) { if(TotalVelasMinimo == 0) { return true; } int total=0; for(int i=0; i<TotalVelasMinimo; i++) { if(Open[i+vela+1] > Close[i+vela+1] && direcao == "call") { total++; } if(Open[i+vela+1] < Close[i+vela+1] && direcao == "put") { total++; }


} if(total >= TotalVelasMinimo) { return true; } return false; } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ bool sequencia(string direcao, int vela) { int total=0; for(int i=0; i<TotalVelasMaximo; i++) { if(Open[i+vela+1] < Close[i+vela+1] && direcao == "call") { return true; } if(Open[i+vela+1] > Close[i+vela+1] && direcao == "put") { return true; } } return false; } //===================================================================== ====================================================================== ================= //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ bool Padrao(string direcao, int vela) { static datetime time=0; int limit=0; int total=0; for(int i = 0; i <= limit; i++) { if(Close[i+vela+1] < Open[i+vela+1] && Close[i+vela+0] < Open[i+vela+0] && direcao == "call") { time=Time[i]; return true; } if(Close[i+vela+1] > Open[i+vela+1] && Close[i+vela+0] > Open[i+vela+0] && direcao == "put")


{ time=Time[i]; return true; } } return false; } //===================================================================== ====================================================================== ================= double LSMA(int Rperiod, int shift) { int i; double sum; int length; double lengthvar; double tmp; double wt; //---- length=Rperiod; //---- sum=0; for(i=length; i>=1 ; i--) { lengthvar=length + 1; lengthvar/=3; tmp=0; tmp =(i - lengthvar)*Close[length-i+shift]; sum+=tmp; } wt=sum*6/(length*(length+1)); //---- return(wt); } //===================================================================== ====================================================================== ================= //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ void CommentLab(string CommentText, int Ydistance, int Xdistance, int Label, int Cor) { int CommentIndex = 0; string label_name = "label" + string(Label); ObjectCreate(0,label_name,OBJ_LABEL,0,0,0); ObjectSetInteger(0,label_name, OBJPROP_CORNER, 1);


//--- set X coordinate ObjectSetInteger(0,label_name,OBJPROP_XDISTANCE,160); //--- set Y coordinate ObjectSetInteger(0,label_name,OBJPROP_YDISTANCE,195); //--- define text color ObjectSetInteger(0,label_name,OBJPROP_COLOR,Cor); //--- define text for object Label ObjectSetString(0,label_name,OBJPROP_TEXT,CommentText); //--- define font ObjectSetString(0,label_name,OBJPROP_FONT,"Tahoma"); //--- define font size ObjectSetInteger(0,label_name,OBJPROP_FONTSIZE,9); //--- disable for mouse selecting ObjectSetInteger(0,label_name,OBJPROP_SELECTABLE,false); ObjectSetInteger(0, label_name,OBJPROP_BACK,false); //--- draw it on the chart ChartRedraw(0); } //===================================================================== ====================================================================== ================= void VerticalLine(int i, color clr) { string objName = "Backtest-Line "+string(iTime(NULL,0,i)); ObjectCreate(objName, OBJ_VLINE,0,Time[i],0); ObjectSet(objName, OBJPROP_COLOR, clr); ObjectSet(objName, OBJPROP_BACK, true); ObjectSet(objName, OBJPROP_STYLE, 1); ObjectSet(objName, OBJPROP_WIDTH, 1); ObjectSet(objName, OBJPROP_SELECTABLE, false); ObjectSet(objName, OBJPROP_HIDDEN, true); } //===================================================================== ====================================================================== ================= //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ void Statistics(bool backtest_value=false) { info.Reset(); for(int i=288; i>=1; i--) { //--- Statistics if(ganhou[i]!=EMPTY_VALUE) {


info.win++; info.count_win++; info.count_entries++; info.count_loss=0; if(info.count_win>info.consecutive_wins) info.consecutive_wins++; if(!backtest_value) VerticalLine(i,clrLimeGreen); } else if(perdeu[i]!=EMPTY_VALUE) { info.loss++; info.count_loss++; info.count_entries++; info.count_win=0; if(info.count_loss>info.consecutive_losses) info.consecutive_losses++; if(!backtest_value) VerticalLine(i,clrRed); } else if(empatou[i]!=EMPTY_VALUE) { info.draw++; info.count_entries++; if(!backtest_value) VerticalLine(i,clrWhiteSmoke); } } } //===================================================================== ====================================================================== ================= void CreateTextLable (string TextLableName, string Text, int TextSize, string FontName, color TextColor, int TextCorner, int X, int Y) { //--- ObjectCreate(TextLableName, OBJ_LABEL, 0, 0, 0); ObjectSet(TextLableName, OBJPROP_CORNER, TextCorner); ObjectSet(TextLableName, OBJPROP_XDISTANCE, X); ObjectSet(TextLableName, OBJPROP_YDISTANCE, Y); ObjectSetText(TextLableName,Text,TextSize,FontName,TextColor); ObjectSetInteger(0,TextLableName,OBJPROP_HIDDEN,true); }


//===================================================================== ====================================================================== ================= //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ void Painel() { color textColor = clrLavender; int Corner = painel; int font_size=8; int font_x=30; int font_x2=25; //martingales string font_type="Time New Roman"; if(info.win != 0) rate = (info.win/(info.win+info.loss))*100; else rate = 0; string backtest_text = "Backtest TaurusEstrategias"; CreateTextLable("backtest",backtest_text,font_size,font_type,clrOrangeRed,Corner,30,5); string divisao_cima = "______________________________"; CreateTextLable("linha_cima",divisao_cima,font_size,font_type,clrYellow,Corner,0,10); string quant = "WIN: "+DoubleToString(info.win,0)+" | LOSS: "+DoubleToString(info.loss,0)+" | EMPATE: "+DoubleToString(info.draw,0); CreateTextLable("wins",quant,font_size,font_type,textColor,Corner,font_x,70); string consecutive_wins = "CONSECUTIVE WINS: "+IntegerToString(info.consecutive_wins); CreateTextLable("consecutive_wins",consecutive_wins,font_size,font_type,textColor,Corner, font_x,90); string consecutive_losses = "CONSECUTIVE LOSSES: "+IntegerToString(info.consecutive_losses); CreateTextLable("consecutive_losses",consecutive_losses,font_size,font_type,textColor,Cor ner,font_x,110); string count_entries = "QUANT ENTRADAS: "+IntegerToString(info.count_entries); CreateTextLable("count_entries",count_entries,font_size,font_type,textColor,Corner,font_x,5 0); string wins_rate = "WIN RATE: "+DoubleToString(rate,0)+"%";


CreateTextLable("wins_rate",wins_rate,font_size,font_type,textColor,Corner,font_x,130); string bars_total = "QUANT VELAS "+IntegerToString(Velas); CreateTextLable("quant",bars_total,font_size,font_type,textColor,Corner,font_x,30); string divisao_baixo = "______________________________"; CreateTextLable("linha_baixo",divisao_cima,font_size,font_type,clrYellow,Corner,0,140); string IaTaurus = "TaurusEstrategias 'OFF"; CreateTextLable("linhaEstrategia1",IaTaurus,10,font_type,clrRed,Corner,20,158); if(COMBINER1 || COMBINER1 || Fluxo || ViradaDeHora || Bloquea1 || EnabledWPR || EnabledMFI || EnabledRVI || value_chart || ativar_SR || ativar_donforex || Bandas || SeR || AtivarCruzamento || HabilitarValueChart || Condicao_Oposta || RSI1 || CCI || Fractal || FiltroDeTendência || AtivarTamanhoVela || AtivarTamanhoVela1 || Harami || Pulback_Enabled || Adx_Enabled || TaurusExtremo ||SO_Enabled) { string divisaoEstrategia3 = "TaurusEstrategias 'ON"; CreateTextLable("linhaEstrategia1",divisaoEstrategia3,10,font_type,clrLime,Corner,20,158); } string divisaoEstrategia = "______________________________"; CreateTextLable("linhaEstrategia",divisaoEstrategia,font_size,font_type,clrYellow,Corner,0,1 70); //string ValueChartmMaxima = "ValueChartMaxima + "+IntegerToString(value_chart_maxima); //CreateTextLable("ValueChart+",ValueChartmMaxima,font_size,font_type,textColor,Corner,f ont_x,190); CommentLab(Symbol()+": ESTATÍSTICAS",0, 0, 0,clrYellow); //string ValueChartMinima = "ValueChartMinima "+IntegerToString(value_chart_minima); // CreateTextLable("ValueChart- ",ValueChartMinima,font_size,font_type,textColor,Corner,font_x,210); string divisaoValueChar = "______________________________"; CreateTextLable("divisaoValueChar",divisaoValueChar,font_size,font_type,clrYellow,Corner, 0,210); } //===================================================================== ====================================================================== ================= //+------------------------------------------------------------------+ //| |


//+------------------------------------------------------------------+ void AumentarDelay(datetime delay) { int file_handle=FileOpen("ultimo_resultado.txt",FILE_READ|FILE_SHARE_READ|FILE_SHARE _WRITE|FILE_WRITE|FILE_TXT); FileWrite(file_handle,delay); FileClose(file_handle); } //===================================================================== ====================================================================== ================= //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ datetime LerArquivoDelay() { int file_handle=FileOpen("ultimo_resultado.txt",FILE_READ|FILE_SHARE_READ|FILE_SHARE _WRITE|FILE_WRITE|FILE_TXT); int str_size=FileReadInteger(file_handle,INT_VALUE); string str=FileReadString(file_handle,int(str_size)); FileClose(file_handle); return StringToTime(str); } //===================================================================== ====================================================================== ================= //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ void OnChartEvent(const int id, const long &lparam, const double &dparam, const string &sparam) { if(id==CHARTEVENT_KEYDOWN) { if((int)lparam==KEY_DELETE) { Alert(arquivo_estatisticas+" foi deletado"); } } } //===================================================================== ====================================================================== =================


//+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ string ExibirResultadoParcialAoVivo() { ushort u_sep = StringGetCharacter(";",0); int str_size; string str="",str_tratada=""; int file_handle=FileOpen(filename_sinais_ao_vivo,FILE_READ|FILE_SHARE_READ|FILE_TXT ); while(!FileIsEnding(file_handle)) { str_size=FileReadInteger(file_handle,INT_VALUE); str=FileReadString(file_handle,str_size); if(str!="") { string result[]; StringSplit(str,u_sep,result); //Symbol(1-hour,2-operation,3-result); if(result[2]=="put") result[2] = " "; else result[2] = " "; if(result[3]=="win" || result[3]=="win#") str_tratada+=" → "+result[0]+" "+result[1]+" "+result[2]+"\n"; if(result[3]=="wing1" || result[3]=="wing1#") str_tratada+=" 1G → "+result[0]+" "+result[1]+" "+result[2]+"\n"; if(result[3]=="wing2" || result[3]=="wing2#") str_tratada+=" 2G → "+result[0]+" "+result[1]+" "+result[2]+"\n"; if(result[3]=="loss" || result[3]=="loss#") str_tratada+=" → "+result[0]+" "+result[1]+" "+result[2]+"\n"; if(result[3]=="lossg1" || result[3]=="lossg1#") str_tratada+="loss G1 → "+result[0]+" "+result[1]+" "+result[2]+"\n"; if(result[3]=="lossg2" || result[3]=="lossg2#") str_tratada+="loss G2 → "+result[0]+" "+result[1]+" "+result[2]+"\n"; } } FileClose(file_handle); return str_tratada;


} //===================================================================== ====================================================================== ================= //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ void filtro_value() { //---escolhe melhor nivel do value int bars; int counted_bars = IndicatorCounted(); static int pa_profile[]; double vc_support_high = VC_Oversold; double vc_resistance_high = VC_Overbought; double vc_support_med = VC_SlightlyOversold; double vc_resistance_med = VC_SlightlyOverbought; // The last counted bar is counted again if(counted_bars > 0) { counted_bars--; } bars = counted_bars; if(bars > BarrasAnalise && BarrasAnalise > 0) { bars = BarrasAnalise; } computes_value_chart(bars, VC_Period); VC_Overbought = vc_resistance_high; VC_SlightlyOverbought = vc_resistance_med; VC_SlightlyOversold = vc_support_med; VC_Oversold = vc_support_high; } //===================================================================== ====================================================================== ================= //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ void computes_value_chart(int bars, int period) { double sum;


double floatingAxis; double volatilityUnit; for(int i = bars-1; i >= 0; i--) { datetime t = Time[i]; int y = iBarShift(NULL, period, t); int z = iBarShift(NULL, 0, iTime(NULL, period, y)); /* Determination of the floating axis */ sum = 0; int N = VC_NumBars; for(int k = y; k < y+N; k++) { sum += (iHigh(NULL, period, k) + iLow(NULL, period, k)) / 2.0; } floatingAxis = sum / VC_NumBars; /* Determination of the volatility unit */ N = VC_NumBars; sum = 0; for(int k = y; k < N + y; k++) { sum += iHigh(NULL, period, k) - iLow(NULL, period, k); } volatilityUnit = 0.2 * (sum / VC_NumBars); volatilityUnit = volatilityUnit==0 ? 0.0001 : volatilityUnit; //corrigir bug do 0 division vcHigh[i] = (iHigh(NULL, period, y) - floatingAxis) / volatilityUnit; vcLow[i] = (iLow(NULL, period, y) - floatingAxis) / volatilityUnit; vcOpen[i] = (iOpen(NULL, period, y) - floatingAxis) / volatilityUnit; vcClose[i] = (iClose(NULL, period, y) - floatingAxis) / volatilityUnit; } } //===================================================================== ====================================================================== ================= //+------------------------------------------------------------------+ //+------------------------------------------------------------------+ bool demo_f() { //demo if(use_demo) { if(Time[0]>=StringToTime(ExpiryDate)) {


Alert(expir_msg); ChartIndicatorDelete(0,0,"TaurusEstrategias"); return(false); } } return(true); } //===================================================================== ====================================================================== ================= //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ bool acc_number_f() { //acc_number if(use_acc_number) { if(AccountNumber()!=acc_number && AccountNumber()!=0) { Alert(acc_numb_msg); ChartIndicatorDelete(0,0,"TaurusEstrategias"); return(false); } } return(true); } int exp_binary(){ MqlDateTime time_Current; TimeToStruct(TimeLocal(),time_Current); int time_Start = 0; int min = 0; int segundo = 0; double sec = 0; for(int j=1; j<60; j++) { if(time_Current.min >= time_Start && time_Current.min < _Period*j) { min = (_Period*j) - (time_Current.min+1); sec = int(((59 - time_Current.sec)*0.01)*100); segundo = sec; break; } else


{ time_Start = _Period*j; }} int minuto = min*60; double total = minuto + segundo; return total; } int time_exp() { MqlDateTime time_Current; TimeToStruct(TimeLocal(),time_Current); int time_Start = 0; int min = 0; double sec = 0; for(int j=1; j<60; j++) { if(time_Current.min >= time_Start && time_Current.min < _Period*j) { min = (_Period*j) - (time_Current.min+1); sec = (59 - time_Current.sec)*0.01; break; } else { time_Start = _Period*j; } } if(_Period==1) { return 1; } if(_Period!=1) { if(sec/0.01 > 30) { return min+1; } else { if(min == 0) { if(sec/0.01 < 30) { return _Period;


} return 1; } return min; } } return _Period; } //===================================================================== ====================================================================== ================= //+------------------------------------------------------------------+ //+------------------------------------------------------------------+ //+------------------------------------------------------------------+


Click to View FlipBook Version