//+------------------------------------------------------------------+ //| VisualTrading.mq4 | //| Dmitry Yakovlev, Russia,Omsk, WM R865705290089 | //| dmitry_yakovlev@rambler.ru | //+------------------------------------------------------------------+ #property copyright "Dmitry Yakovlev, Russia,Omsk, WM R865705290089" #property link "dmitry_yakovlev@rambler.ru" #import "shell32.dll" //Connect a dll (provided with Windows) int ShellExecuteA(int hwnd,string Operation,string File,string Parameters,string Directory,int ShowCmd); #import "user32.dll" int MessageBoxA(int hWnd ,string lpText,string lpCaption,int uType); #import extern color OpenColor=Yellow; extern color TakeProfitColor=Lime; extern color StopLossColor=Red; extern bool lShowTargets=true; extern string _donate1="Для $ благодарностей:"; extern string _donate2="R865705290089"; int cnt=0; int awh[]; void init() { int i=0,j=0; string n; CheckDonate(); DeleteHistory(); for(i=0;iBid)) { ObjectSet(n+"stop",OBJPROP_PRICE1,OrderStopLoss());//continue; } if((OrderType()==OP_SELL) && (NormalizeDouble(pstop,Digits)0) prof_clr=Green; ObjectCreate(Symbol()+DoubleToStr(Period(),0)+"topen"+i,OBJ_TEXT,0,CT,OrderOpenPrice()+CP); txt=""; if(OrderType()==0 || OrderType()==1) txt=" ("+DoubleToStr(MathAbs(prof),2)+"$)"; ObjectSetText(Symbol()+DoubleToStr(Period(),0)+"topen"+i,DoubleToStr(MathAbs(prof_pts),0)+txt,FS,"Arial",prof_clr); dist_take_pts=0;dist_take=0; if(OrderTakeProfit()!=0) { dist_take_pts=MathAbs(pr/Point-OrderTakeProfit()/Point); txt=DoubleToStr(dist_take_pts,0); dist_take_pts=MathAbs(OrderOpenPrice()/Point-OrderTakeProfit()/Point); txt=txt+"("+DoubleToStr(dist_take_pts,0)+"/"+DoubleToStr(dist_take_pts*OrderLots()*10,0)+"$)"; ObjectCreate(Symbol()+DoubleToStr(Period(),0)+"ttake"+i,OBJ_TEXT,0,CT,OrderTakeProfit()+CP); ObjectSetText(Symbol()+DoubleToStr(Period(),0)+"ttake"+i,txt,FS,"Arial",Green); } dist_stop_pts=0;dist_stop=0; if(OrderStopLoss()!=0) { dist_stop_pts=MathAbs(pr/Point-OrderStopLoss()/Point); txt=DoubleToStr(dist_stop_pts,0); dist_stop_pts=MathAbs(OrderOpenPrice()/Point-OrderStopLoss()/Point); txt=txt+"("+DoubleToStr(dist_stop_pts,0)+"/"+DoubleToStr(dist_stop_pts*OrderLots()*10,0)+"$)"; ObjectCreate(Symbol()+DoubleToStr(Period(),0)+"tstop"+i,OBJ_TEXT,0,CT,OrderStopLoss()+CP); ObjectSetText(Symbol()+DoubleToStr(Period(),0)+"tstop"+i,txt,FS,"Arial",Red); } // рисуем---> } } void DeleteLabels() { int i=0; string n=""; int t=Time[WindowFirstVisibleBar()]; for(i=0;i=1) { pay=FileReadString(fd); if(pay!="0" && pay!="1") pay="0"; dt=StrToTime(FileReadString(fd)); } else { dt=TimeCurrent(); fd=FileOpen(fn,FILE_WRITE|FILE_CSV,";"); FileWrite(fd,"0",TimeToStr(dt,TIME_DATE)); } FileClose(fd); if(pay=="0" && (TimeCurrent()-dt)>10*24*60*60) // 5 дней { if(MessageBoxA(0,"Если Вам понравился советник VisualTrading,\n хотите помочь автору материально?","Вопрос",4)==6) { ShellExecuteA(0,"Open","iexplore.exe","wmk:payto?Purse=R865705290089&Amount=100&Desc=VisualTrading&BringToFront=Y&ExecEvenKeeperIsOffline=Y","",7); pay="1"; } dt=TimeCurrent(); fd=FileOpen(fn,FILE_WRITE|FILE_CSV,";"); FileWrite(fd,pay,TimeToStr(dt,TIME_DATE)); FileClose(fd); } FileClose(fd); }