Merhaba! Manuel bir danışmanı düzenlemek için küçük yardımınıza ihtiyacım var ........ Moose ve kar ayarlanmadı ve takip ayarlanmadı
Yazara sormayı deneyin https://www.mql5.com/en/code/13940
![Немедленное исполнение Немедленное исполнение](https://c.mql5.com/36/37/nemedlennoe-ispolnenie.jpg)
- www.mql5.com
Eğer burada oturuyorsa ...... bu pek olası değil!
Yardımcı olmakta bir sakınca yoksa şimdi deneyeceğim. Görünüşe göre bu koddan bir şeyi kör etmeye çalışıyorum
------------------------------------
dene - bundan bir şey yap ve ben de yapacağım
//+------------------------------------------------------------------+ //| InstantExecution.mq4 | //| Copyright 2015, @traderconfident | //| https://confident-trader.blogspot.com | //+------------------------------------------------------------------+ #property copyright "Copyright 2015, @traderconfident" #property link "https://confident-trader.blogspot.com" #property version "1.0" #property strict //+------------------------------------------------------------------+ //| Expert initialization function | //+------------------------------------------------------------------+ extern string _Orders_= " --- Set Order ---" ; extern double Lots= 0.05 ; extern int StopLoss= 0 ; extern int TakeProfit= 70 ; extern int TrailingStart= 20 ; extern int TrailingStop = 10 ; extern int TrailingStep = 5 ; extern int MaxOrderAtOnceTime= 1 ; extern int Slippage= 3 ; extern int Magic= 90910 ; double _sl,_tp,_pip; //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int OnInit () { _pip= Point ; if ( Digits == 3 || Digits == 5 ) _pip= 10 * Point ; //--- ObjectCreate ( 0 , "CloseButton" , OBJ_BUTTON , 0 , 0 , 0 ); ObjectSetInteger ( 0 , "CloseButton" , OBJPROP_XDISTANCE , 10 ); ObjectSetInteger ( 0 , "CloseButton" , OBJPROP_YDISTANCE , 15 ); ObjectSetInteger ( 0 , "CloseButton" , OBJPROP_XSIZE , 100 ); ObjectSetInteger ( 0 , "CloseButton" , OBJPROP_YSIZE , 25 ); ObjectSetString ( 0 , "CloseButton" , OBJPROP_TEXT , "Close Orders" ); ObjectSetInteger ( 0 , "CloseButton" , OBJPROP_COLOR ,White); ObjectSetInteger ( 0 , "CloseButton" , OBJPROP_BGCOLOR ,Red); ObjectSetInteger ( 0 , "CloseButton" , OBJPROP_BORDER_COLOR ,Red); ObjectSetInteger ( 0 , "CloseButton" , OBJPROP_BORDER_TYPE , BORDER_FLAT ); ObjectSetInteger ( 0 , "CloseButton" , OBJPROP_HIDDEN , true ); ObjectSetInteger ( 0 , "CloseButton" , OBJPROP_STATE , false ); ObjectSetInteger ( 0 , "CloseButton" , OBJPROP_FONTSIZE , 12 ); //Exit ObjectCreate ( 0 , "Exit" , OBJ_BUTTON , 0 , 0 , 0 ); ObjectSetInteger ( 0 , "Exit" , OBJPROP_XDISTANCE , 120 ); ObjectSetInteger ( 0 , "Exit" , OBJPROP_YDISTANCE , 15 ); ObjectSetInteger ( 0 , "Exit" , OBJPROP_XSIZE , 80 ); ObjectSetInteger ( 0 , "Exit" , OBJPROP_YSIZE , 25 ); ObjectSetString ( 0 , "Exit" , OBJPROP_TEXT , "Exit" ); ObjectSetInteger ( 0 , "Exit" , OBJPROP_COLOR ,White); ObjectSetInteger ( 0 , "Exit" , OBJPROP_BGCOLOR ,Green); ObjectSetInteger ( 0 , "Exit" , OBJPROP_BORDER_COLOR ,Green); ObjectSetInteger ( 0 , "Exit" , OBJPROP_BORDER_TYPE , BORDER_FLAT ); ObjectSetInteger ( 0 , "Exit" , OBJPROP_HIDDEN , true ); ObjectSetInteger ( 0 , "Exit" , OBJPROP_STATE , false ); ObjectSetInteger ( 0 , "Exit" , OBJPROP_FONTSIZE , 12 ); //Buy ObjectCreate ( 0 , "Buy" , OBJ_BUTTON , 0 , 0 , 0 ); ObjectSetInteger ( 0 , "Buy" , OBJPROP_XDISTANCE , 210 ); ObjectSetInteger ( 0 , "Buy" , OBJPROP_YDISTANCE , 15 ); ObjectSetInteger ( 0 , "Buy" , OBJPROP_XSIZE , 50 ); ObjectSetInteger ( 0 , "Buy" , OBJPROP_YSIZE , 25 ); ObjectSetString ( 0 , "Buy" , OBJPROP_TEXT , "Buy" ); ObjectSetInteger ( 0 , "Buy" , OBJPROP_COLOR ,White); ObjectSetInteger ( 0 , "Buy" , OBJPROP_BGCOLOR ,Blue); ObjectSetInteger ( 0 , "Buy" , OBJPROP_BORDER_COLOR ,Blue); ObjectSetInteger ( 0 , "Buy" , OBJPROP_BORDER_TYPE , BORDER_FLAT ); ObjectSetInteger ( 0 , "Buy" , OBJPROP_HIDDEN , true ); ObjectSetInteger ( 0 , "Buy" , OBJPROP_STATE , false ); ObjectSetInteger ( 0 , "Buy" , OBJPROP_FONTSIZE , 12 ); //Sell ObjectCreate ( 0 , "Sell" , OBJ_BUTTON , 0 , 0 , 0 ); ObjectSetInteger ( 0 , "Sell" , OBJPROP_XDISTANCE , 270 ); ObjectSetInteger ( 0 , "Sell" , OBJPROP_YDISTANCE , 15 ); ObjectSetInteger ( 0 , "Sell" , OBJPROP_XSIZE , 50 ); ObjectSetInteger ( 0 , "Sell" , OBJPROP_YSIZE , 25 ); ObjectSetString ( 0 , "Sell" , OBJPROP_TEXT , "Sell" ); ObjectSetInteger ( 0 , "Sell" , OBJPROP_COLOR ,White); ObjectSetInteger ( 0 , "Sell" , OBJPROP_BGCOLOR ,Gray); ObjectSetInteger ( 0 , "Sell" , OBJPROP_BORDER_COLOR ,Gray); ObjectSetInteger ( 0 , "Sell" , OBJPROP_BORDER_TYPE , BORDER_FLAT ); ObjectSetInteger ( 0 , "Sell" , OBJPROP_HIDDEN , true ); ObjectSetInteger ( 0 , "Sell" , OBJPROP_STATE , false ); ObjectSetInteger ( 0 , "Sell" , OBJPROP_FONTSIZE , 12 ); //Closed at Profit ObjectCreate ( 0 , "CloseAtProfit" , OBJ_BUTTON , 0 , 0 , 0 ); ObjectSetInteger ( 0 , "CloseAtProfit" , OBJPROP_XDISTANCE , 330 ); ObjectSetInteger ( 0 , "CloseAtProfit" , OBJPROP_YDISTANCE , 15 ); ObjectSetInteger ( 0 , "CloseAtProfit" , OBJPROP_XSIZE , 100 ); ObjectSetInteger ( 0 , "CloseAtProfit" , OBJPROP_YSIZE , 25 ); ObjectSetString ( 0 , "CloseAtProfit" , OBJPROP_TEXT , "Close Profit" ); ObjectSetInteger ( 0 , "CloseAtProfit" , OBJPROP_COLOR ,White); ObjectSetInteger ( 0 , "CloseAtProfit" , OBJPROP_BGCOLOR ,Green); ObjectSetInteger ( 0 , "CloseAtProfit" , OBJPROP_BORDER_COLOR ,Green); ObjectSetInteger ( 0 , "CloseAtProfit" , OBJPROP_BORDER_TYPE , BORDER_FLAT ); ObjectSetInteger ( 0 , "CloseAtProfit" , OBJPROP_HIDDEN , true ); ObjectSetInteger ( 0 , "CloseAtProfit" , OBJPROP_STATE , false ); ObjectSetInteger ( 0 , "CloseAtProfit" , OBJPROP_FONTSIZE , 12 ); //--- return ( INIT_SUCCEEDED ); } //+------------------------------------------------------------------+ //| Expert deinitialization function | //+------------------------------------------------------------------+ void OnDeinit ( const int reason) { //--- } //+------------------------------------------------------------------+ //| Expert tick function | //+------------------------------------------------------------------+ int start() { if (TrailingStart> 0 ) Trailing(); OnChartEvent1(); return ( 0 ); } //+------------------------------------------------------------------+ //| ChartEvent function | //+------------------------------------------------------------------+ void OnChartEvent1() { int _ticket= 0 ; { int total= OrdersTotal (); int i = 0 ; for (i = total; i >= 0 ; i--) { if ( OrderSelect (i,SELECT_BY_POS) && OrderSymbol()== Symbol ()) { //OrderSelect(i,SELECT_BY_POS); if (OrderSymbol()== Symbol () && (OrderType()==OP_BUY || OrderType()==OP_SELL)) { _ticket = OrderClose(OrderTicket(),OrderLots(),MarketInfo( Symbol (),MODE_ASK), 5 ); _ticket = OrderClose(OrderTicket(),OrderLots(),MarketInfo( Symbol (),MODE_BID), 5 ); } } } if (_ticket> 0 ) { if ( ObjectGetInteger ( 0 , "CloseButton" , OBJPROP_STATE )!= 0 ) { ObjectSetInteger ( 0 , "CloseButton" , OBJPROP_STATE , 0 ); ObjectsDeleteAll (); ExpertRemove (); } } } { if ( ObjectGetInteger ( 0 , "Exit" , OBJPROP_STATE )!= 0 ) { ObjectSetInteger ( 0 , "Exit" , OBJPROP_STATE , 0 ); ObjectsDeleteAll (); ExpertRemove (); } } { if ( ObjectGetInteger ( 0 , "Buy" , OBJPROP_STATE )!= 0 ) { ObjectSetInteger ( 0 , "Buy" , OBJPROP_STATE , 0 ); _ticket=Order( "BUY" ); } } { if ( ObjectGetInteger ( 0 , "Sell" , OBJPROP_STATE )!= 0 ) { ObjectSetInteger ( 0 , "Sell" , OBJPROP_STATE , 0 ); _ticket=Order( "SELL" ); } } { if ( ObjectGetInteger ( 0 , "CloseAtProfit" , OBJPROP_STATE )!= 0 ) { ObjectSetInteger ( 0 , "CloseAtProfit" , OBJPROP_STATE , 0 ); CloseAtProfit(); } } } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ void Trailing() { int ticket= 0 ; for ( int cnt= 0 ; cnt< OrdersTotal (); cnt++) { ticket= OrderSelect (cnt,SELECT_BY_POS,MODE_TRADES); if (OrderSymbol()== Symbol () && OrderMagicNumber()==Magic) { if (OrderType()==OP_BUY) { if ((TakeProfit> 0 && Bid-OrderOpenPrice()>=TakeProfit*_pip) || (StopLoss> 0 && OrderOpenPrice()-Ask>StopLoss*_pip)) { ticket=OrderClose(OrderTicket(),OrderLots(),Bid, 0 ,Violet); } if (TrailingStart> 0 ) { if (OrderStopLoss()== 0 ) { if (Bid-OrderOpenPrice()>TrailingStart*_pip) { ticket=OrderModify(OrderTicket(),OrderOpenPrice(),Bid-TrailingStop*_pip,OrderTakeProfit(), 0 ,Gray); } } else { if (Bid-OrderStopLoss()>Bid-TrailingStep*_pip) { ticket=OrderModify(OrderTicket(),OrderOpenPrice(),Bid-TrailingStop*_pip,OrderTakeProfit(), 0 ,Gray); } } } } if (OrderType()==OP_SELL) { if ((TakeProfit> 0 && OrderOpenPrice()-Ask>=TakeProfit*_pip) || (StopLoss> 0 && Bid-OrderOpenPrice()>StopLoss*_pip)) { ticket=OrderClose(OrderTicket(),OrderLots(),Ask, 0 ,Violet); } if (TrailingStart> 0 ) { if (OrderStopLoss()== 0 ) { if (OrderOpenPrice()-Ask>TrailingStart*_pip) { ticket=OrderModify(OrderTicket(),OrderOpenPrice(),Ask+TrailingStop*_pip,OrderTakeProfit(), 0 ,Gray); } } else { if (OrderStopLoss()>Ask+TrailingStep*_pip) { ticket=OrderModify(OrderTicket(),OrderOpenPrice(),Ask+TrailingStop*_pip,OrderTakeProfit(), 0 ,Gray); } } } } } } } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ void CloseAtProfit() { int ticket= 0 ; RefreshRates(); for ( int cnt= 0 ; cnt< OrdersTotal (); cnt++) { ticket= OrderSelect (cnt,SELECT_BY_POS,MODE_TRADES); if (OrderSymbol()== Symbol () && OrderType()==OP_BUY && Bid>OrderOpenPrice()) { ticket=OrderClose(OrderTicket(),OrderLots(),Bid, 0 ,Violet); } if (OrderSymbol()== Symbol () && OrderType()==OP_SELL && OrderOpenPrice()>Ask) { ticket=OrderClose(OrderTicket(),OrderLots(),Ask, 0 ,Violet); } } } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int Order( string _Order) { int i,ticket= 0 ; _sl = 0.0 ; _tp = 0.0 ; if (_Order== "BUY" ) { for (i= 0 ; i<MaxOrderAtOnceTime; i++) { ticket= OrderSend ( Symbol (),OP_BUY,Lots,Ask,Slippage,_sl,_tp, "" ,Magic, 0 ,Blue); } } else { for (i= 0 ; i<MaxOrderAtOnceTime; i++) { ticket= OrderSend ( Symbol (),OP_SELL,Lots,Bid,Slippage,_sl,_tp, "" ,Magic, 0 ,Red); } } return (ticket); } //+------------------------------------------------------------------+ //+------------------------------------------------------------------+ //+------------------------------------------------------------------+ //+------------------------------------------------------------------+
Yardımcı olmakta bir sakınca yoksa şimdi deneyeceğim. Görünüşe göre bu koddan bir şeyi kör etmeye çalışıyorum
------------------------------------
dene - bundan bir şeyler yap ve ben de yapacağım
İyi ..... teşekkürler Sasha!
Şimdi karıştıracağız ........
İyi ..... teşekkürler Sasha!
Şimdi karıştıracağız ........
hiçbir şey, bir şey olursa benimle iletişime geç
bir şey çıkardı ...... durur çalışmaya başladı karlar henüz çalışmıyor
//+------------------------------------------------------------------+ //| InstantExecution.mq4 | //| Copyright 2015, @traderconfident | //| https://confident-trader.blogspot.com | //+------------------------------------------------------------------+ #property copyright "Copyright 2015, @traderconfident" #property link "https://confident-trader.blogspot.com" #property version "1.0" #property strict //+------------------------------------------------------------------+ //| Expert initialization function | //+------------------------------------------------------------------+ extern string _Orders_= " --- Set Order ---" ; extern double Lots= 0.05 ; extern int StopLoss= 0 ; extern int TakeProfit= 70 ; extern int TrailingStart= 20 ; extern int TrailingStop = 10 ; extern int TrailingStep = 5 ; extern int MaxOrderAtOnceTime= 1 ; extern int Slippage= 3 ; extern int Magic= 90910 ; double _sl,_tp,_pip; //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int OnInit () { _pip= Point ; if ( Digits == 3 || Digits == 5 ) _pip= 10 * Point ; //--- ObjectCreate ( 0 , "CloseButton" , OBJ_BUTTON , 0 , 0 , 0 ); ObjectSetInteger ( 0 , "CloseButton" , OBJPROP_XDISTANCE , 10 ); ObjectSetInteger ( 0 , "CloseButton" , OBJPROP_YDISTANCE , 15 ); ObjectSetInteger ( 0 , "CloseButton" , OBJPROP_XSIZE , 100 ); ObjectSetInteger ( 0 , "CloseButton" , OBJPROP_YSIZE , 25 ); ObjectSetString ( 0 , "CloseButton" , OBJPROP_TEXT , "Close Orders" ); ObjectSetInteger ( 0 , "CloseButton" , OBJPROP_COLOR ,White); ObjectSetInteger ( 0 , "CloseButton" , OBJPROP_BGCOLOR ,Red); ObjectSetInteger ( 0 , "CloseButton" , OBJPROP_BORDER_COLOR ,Red); ObjectSetInteger ( 0 , "CloseButton" , OBJPROP_BORDER_TYPE , BORDER_FLAT ); ObjectSetInteger ( 0 , "CloseButton" , OBJPROP_HIDDEN , true ); ObjectSetInteger ( 0 , "CloseButton" , OBJPROP_STATE , false ); ObjectSetInteger ( 0 , "CloseButton" , OBJPROP_FONTSIZE , 12 ); //Exit ObjectCreate ( 0 , "Exit" , OBJ_BUTTON , 0 , 0 , 0 ); ObjectSetInteger ( 0 , "Exit" , OBJPROP_XDISTANCE , 120 ); ObjectSetInteger ( 0 , "Exit" , OBJPROP_YDISTANCE , 15 ); ObjectSetInteger ( 0 , "Exit" , OBJPROP_XSIZE , 80 ); ObjectSetInteger ( 0 , "Exit" , OBJPROP_YSIZE , 25 ); ObjectSetString ( 0 , "Exit" , OBJPROP_TEXT , "Exit" ); ObjectSetInteger ( 0 , "Exit" , OBJPROP_COLOR ,White); ObjectSetInteger ( 0 , "Exit" , OBJPROP_BGCOLOR ,Green); ObjectSetInteger ( 0 , "Exit" , OBJPROP_BORDER_COLOR ,Green); ObjectSetInteger ( 0 , "Exit" , OBJPROP_BORDER_TYPE , BORDER_FLAT ); ObjectSetInteger ( 0 , "Exit" , OBJPROP_HIDDEN , true ); ObjectSetInteger ( 0 , "Exit" , OBJPROP_STATE , false ); ObjectSetInteger ( 0 , "Exit" , OBJPROP_FONTSIZE , 12 ); //Buy ObjectCreate ( 0 , "Buy" , OBJ_BUTTON , 0 , 0 , 0 ); ObjectSetInteger ( 0 , "Buy" , OBJPROP_XDISTANCE , 210 ); ObjectSetInteger ( 0 , "Buy" , OBJPROP_YDISTANCE , 15 ); ObjectSetInteger ( 0 , "Buy" , OBJPROP_XSIZE , 50 ); ObjectSetInteger ( 0 , "Buy" , OBJPROP_YSIZE , 25 ); ObjectSetString ( 0 , "Buy" , OBJPROP_TEXT , "Buy" ); ObjectSetInteger ( 0 , "Buy" , OBJPROP_COLOR ,White); ObjectSetInteger ( 0 , "Buy" , OBJPROP_BGCOLOR ,Blue); ObjectSetInteger ( 0 , "Buy" , OBJPROP_BORDER_COLOR ,Blue); ObjectSetInteger ( 0 , "Buy" , OBJPROP_BORDER_TYPE , BORDER_FLAT ); ObjectSetInteger ( 0 , "Buy" , OBJPROP_HIDDEN , true ); ObjectSetInteger ( 0 , "Buy" , OBJPROP_STATE , false ); ObjectSetInteger ( 0 , "Buy" , OBJPROP_FONTSIZE , 12 ); //Sell ObjectCreate ( 0 , "Sell" , OBJ_BUTTON , 0 , 0 , 0 ); ObjectSetInteger ( 0 , "Sell" , OBJPROP_XDISTANCE , 270 ); ObjectSetInteger ( 0 , "Sell" , OBJPROP_YDISTANCE , 15 ); ObjectSetInteger ( 0 , "Sell" , OBJPROP_XSIZE , 50 ); ObjectSetInteger ( 0 , "Sell" , OBJPROP_YSIZE , 25 ); ObjectSetString ( 0 , "Sell" , OBJPROP_TEXT , "Sell" ); ObjectSetInteger ( 0 , "Sell" , OBJPROP_COLOR ,White); ObjectSetInteger ( 0 , "Sell" , OBJPROP_BGCOLOR ,Gray); ObjectSetInteger ( 0 , "Sell" , OBJPROP_BORDER_COLOR ,Gray); ObjectSetInteger ( 0 , "Sell" , OBJPROP_BORDER_TYPE , BORDER_FLAT ); ObjectSetInteger ( 0 , "Sell" , OBJPROP_HIDDEN , true ); ObjectSetInteger ( 0 , "Sell" , OBJPROP_STATE , false ); ObjectSetInteger ( 0 , "Sell" , OBJPROP_FONTSIZE , 12 ); //Closed at Profit ObjectCreate ( 0 , "CloseAtProfit" , OBJ_BUTTON , 0 , 0 , 0 ); ObjectSetInteger ( 0 , "CloseAtProfit" , OBJPROP_XDISTANCE , 330 ); ObjectSetInteger ( 0 , "CloseAtProfit" , OBJPROP_YDISTANCE , 15 ); ObjectSetInteger ( 0 , "CloseAtProfit" , OBJPROP_XSIZE , 100 ); ObjectSetInteger ( 0 , "CloseAtProfit" , OBJPROP_YSIZE , 25 ); ObjectSetString ( 0 , "CloseAtProfit" , OBJPROP_TEXT , "Close Profit" ); ObjectSetInteger ( 0 , "CloseAtProfit" , OBJPROP_COLOR ,White); ObjectSetInteger ( 0 , "CloseAtProfit" , OBJPROP_BGCOLOR ,Green); ObjectSetInteger ( 0 , "CloseAtProfit" , OBJPROP_BORDER_COLOR ,Green); ObjectSetInteger ( 0 , "CloseAtProfit" , OBJPROP_BORDER_TYPE , BORDER_FLAT ); ObjectSetInteger ( 0 , "CloseAtProfit" , OBJPROP_HIDDEN , true ); ObjectSetInteger ( 0 , "CloseAtProfit" , OBJPROP_STATE , false ); ObjectSetInteger ( 0 , "CloseAtProfit" , OBJPROP_FONTSIZE , 12 ); //--- return ( INIT_SUCCEEDED ); } //+------------------------------------------------------------------+ //| Expert deinitialization function | //+------------------------------------------------------------------+ void OnDeinit ( const int reason) { //--- } //+------------------------------------------------------------------+ //| Expert tick function | //+------------------------------------------------------------------+ int start() { if (TrailingStart> 0 ) Trailing(); OnChartEvent1(); return ( 0 ); } //+------------------------------------------------------------------+ //| ChartEvent function | //+------------------------------------------------------------------+ void OnChartEvent1() { int _ticket= 0 ; { int total= OrdersTotal (); int i = 0 ; for (i = total; i >= 0 ; i--) { if ( OrderSelect (i,SELECT_BY_POS) && OrderSymbol()== Symbol ()) { //OrderSelect(i,SELECT_BY_POS); if (OrderSymbol()== Symbol () && (OrderType()==OP_BUY || OrderType()==OP_SELL)) { _ticket = OrderClose(OrderTicket(),OrderLots(),MarketInfo( Symbol (),MODE_ASK), 5 ); _ticket = OrderClose(OrderTicket(),OrderLots(),MarketInfo( Symbol (),MODE_BID), 5 ); } } } if (_ticket> 0 ) { if ( ObjectGetInteger ( 0 , "CloseButton" , OBJPROP_STATE )!= 0 ) { ObjectSetInteger ( 0 , "CloseButton" , OBJPROP_STATE , 0 ); ObjectsDeleteAll (); ExpertRemove (); } } } { if ( ObjectGetInteger ( 0 , "Exit" , OBJPROP_STATE )!= 0 ) { ObjectSetInteger ( 0 , "Exit" , OBJPROP_STATE , 0 ); ObjectsDeleteAll (); ExpertRemove (); } } { if ( ObjectGetInteger ( 0 , "Buy" , OBJPROP_STATE )!= 0 ) { ObjectSetInteger ( 0 , "Buy" , OBJPROP_STATE , 0 ); _ticket=Order( "BUY" ); } } { if ( ObjectGetInteger ( 0 , "Sell" , OBJPROP_STATE )!= 0 ) { ObjectSetInteger ( 0 , "Sell" , OBJPROP_STATE , 0 ); _ticket=Order( "SELL" ); } } { if ( ObjectGetInteger ( 0 , "CloseAtProfit" , OBJPROP_STATE )!= 0 ) { ObjectSetInteger ( 0 , "CloseAtProfit" , OBJPROP_STATE , 0 ); CloseAtProfit(); } } } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ void Trailing() { int ticket= 0 ; for ( int cnt= 0 ; cnt< OrdersTotal (); cnt++) { ticket= OrderSelect (cnt,SELECT_BY_POS,MODE_TRADES); if (OrderSymbol()== Symbol () && OrderMagicNumber()==Magic) { if (OrderType()==OP_BUY) { if ((TakeProfit> 0 && Bid+OrderOpenPrice()<=TakeProfit*_pip) || (StopLoss> 0 && OrderOpenPrice()-Ask>StopLoss*_pip)) { ticket=OrderClose(OrderTicket(),OrderLots(),Bid, 0 ,Violet); } if (TrailingStart> 0 ) { if (OrderStopLoss()== 0 ) { if (Bid-OrderOpenPrice()<TrailingStart*_pip) { ticket=OrderModify(OrderTicket(),OrderOpenPrice(),Bid-TrailingStop*_pip,OrderTakeProfit(), 0 ,Gray); } } else { if (Bid-OrderStopLoss()<Bid+TrailingStep*_pip) { ticket=OrderModify(OrderTicket(),OrderOpenPrice(),Bid+TrailingStop*_pip,OrderTakeProfit(), 0 ,Gray); } } } } if (OrderType()==OP_SELL) { if ((TakeProfit> 0 && OrderOpenPrice()+Ask<=TakeProfit*_pip) || (StopLoss> 0 && Bid-OrderOpenPrice()>StopLoss*_pip)) { ticket=OrderClose(OrderTicket(),OrderLots(),Ask, 0 ,Violet); } if (TrailingStart> 0 ) { if (OrderStopLoss()== 0 ) { if (OrderOpenPrice()-Ask<TrailingStart*_pip) { ticket=OrderModify(OrderTicket(),OrderOpenPrice(),Ask-TrailingStop*_pip,OrderTakeProfit(), 0 ,Gray); } } else { if (OrderStopLoss()<Ask+TrailingStep*_pip) { ticket=OrderModify(OrderTicket(),OrderOpenPrice(),Ask-TrailingStop*_pip,OrderTakeProfit(), 0 ,Gray); } } } } } } } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ void CloseAtProfit() { int ticket= 0 ; RefreshRates(); for ( int cnt= 0 ; cnt< OrdersTotal (); cnt++) { ticket= OrderSelect (cnt,SELECT_BY_POS,MODE_TRADES); if (OrderSymbol()== Symbol () && OrderType()==OP_BUY && Bid>OrderOpenPrice()) { ticket=OrderClose(OrderTicket(),OrderLots(),Bid, 0 ,Violet); } if (OrderSymbol()== Symbol () && OrderType()==OP_SELL && OrderOpenPrice()>Ask) { ticket=OrderClose(OrderTicket(),OrderLots(),Ask, 0 ,Violet); } } } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int Order( string _Order) { int i,ticket= 0 ; _sl = 0.0 ; _tp = 0.0 ; if (_Order== "BUY" ) { for (i= 0 ; i<MaxOrderAtOnceTime; i++) { ticket= OrderSend ( Symbol (),OP_BUYSTOP,Lots,Ask,Slippage,_sl,_tp, "" ,Magic, 0 ,Blue); } } else { for (i= 0 ; i<MaxOrderAtOnceTime; i++) { ticket= OrderSend ( Symbol (),OP_SELLSTOP,Lots,Bid,Slippage,_sl,_tp, "" ,Magic, 0 ,Red); } } return (ticket); } //+------------------------------------------------------------------+ //+------------------------------------------------------------------+ //+------------------------------------------------------------------+ //+------------------------------------------------------------------+
bir şey çıkardı ...... durur çalışmaya başladı karlar henüz çalışmıyor
buradan başlamalısın.
Bu şekilde düzelt
//+------------------------------------------------------------------+ //| ChartEvent function | //+------------------------------------------------------------------+ void OnChartEvent1() { int ticket; if ( ObjectGetInteger ( 0 , "CloseAtProfit" , OBJPROP_STATE )!= 0 ) { ObjectSetInteger ( 0 , "CloseAtProfit" , OBJPROP_STATE , 0 ); CloseAtProfit(); } if ( ObjectGetInteger ( 0 , "CloseButton" , OBJPROP_STATE )!= 0 ) { ObjectSetInteger ( 0 , "CloseButton" , OBJPROP_STATE , 0 ); ObjectsDeleteAll (); ExpertRemove (); } if ( ObjectGetInteger ( 0 , "Exit" , OBJPROP_STATE )!= 0 ) { ObjectSetInteger ( 0 , "Exit" , OBJPROP_STATE , 0 ); ObjectsDeleteAll (); ExpertRemove (); } if ( ObjectGetInteger ( 0 , "Buy" , OBJPROP_STATE )!= 0 ) { ObjectSetInteger ( 0 , "Buy" , OBJPROP_STATE , 0 ); { ticket= OrderSend ( Symbol (),OP_BUY,Lots,Ask, 3 , 0 ,Ask+TakeProfit* Point , "macd sample" , 16384 , 0 ,Green); if (ticket> 0 ) { if ( OrderSelect (ticket,SELECT_BY_TICKET,MODE_TRADES)) Print ( "BUY order opened : " ,OrderOpenPrice()); } else Print ( "Error opening BUY order : " , GetLastError ()); return ; } } if ( ObjectGetInteger ( 0 , "Sell" , OBJPROP_STATE )!= 0 ) { ObjectSetInteger ( 0 , "Sell" , OBJPROP_STATE , 0 ); { ticket= OrderSend ( Symbol (),OP_SELL,Lots,Bid, 3 , 0 ,Bid-TakeProfit* Point , "macd sample" , 16384 , 0 ,Red); if (ticket> 0 ) { if ( OrderSelect (ticket,SELECT_BY_TICKET,MODE_TRADES)) Print ( "SELL order opened : " ,OrderOpenPrice()); } else Print ( "Error opening SELL order : " , GetLastError ()); } return ; } } //+------------------------------------------------------------------+
WOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO away!!!!!!!!!! Kazanıldı!!!!!!!!!!!!!!!!!!!!
sadece sihri düzeltin (bunlar 16384'ün yerini alıyor) ve zararı durdurmayı bitirin (0 0 ,Teklif Al-Kar* Puanının olduğu bu yerde )
![MQL5 - MetaTrader 5 müşteri terminalinde yerleşik ticaret stratejileri dili](https://c.mql5.com/i/registerlandings/logo-2.png)
- Ücretsiz ticaret uygulamaları
- İşlem kopyalama için 8.000'den fazla sinyal
- Finansal piyasaları keşfetmek için ekonomik haberler
Gizlilik ve Veri Koruma Politikasını ve MQL5.com Kullanım Şartlarını kabul edersiniz
Merhaba! Manuel bir danışmanı düzenlemek için küçük yardımınıza ihtiyacım var ........ Moose ve kar ayarlanmadı ve takip ayarlanmadı