Metatrader Forum | Forex Expert-Advisor | Broker & Forex Tools

Metatrader Forum | Forex Expert-Advisor | Broker & Forex Tools (http://www.expert-advisor.com/forum/index.php)
-   Programmierung MQL4 (http://www.expert-advisor.com/forum/forumdisplay.php?f=220)
-   -   StopLoss Error (http://www.expert-advisor.com/forum/showthread.php?t=6170)

Ceo 12.08.18 12:03

StopLoss Error
 
Ich hab wieder ein kleines Problem. Es funktioniert alles soweit ganz gut nur nach einiger Zeit kommt Error 130 also der SL ist zu eng obwohl ich einen Abstand eingebaut habe?

Code:

if(total==1 && OR==1 && val> Bid + 30*Point)
            {
         
         
           
            if(NormalizeDouble(OrderStopLoss(), Digits) != NormalizeDouble(val, Digits))
            if(OrderType() == OP_SELL && OrderStopLoss() != val)
            if(!OrderModify(OrderTicket(),OrderOpenPrice(),val,OrderTakeProfit(),0,Green))
            Print("Error Modify to Low2");
            else
            {
            Print("OpenPrice Modify Low2");
           
            }
         
 
          }
 
     
          int val_index=iHighest(NULL,0,MODE_HIGH,KerzeCount,1);
          if(val_index!=-1) val=High[val_index];


Leopold 12.08.18 14:20

Hallo,

Stop Level abfragen mit MarketInfo().

https://docs.mql4.com/marketinformation/marketinfo
https://docs.mql4.com/constants/envi...tinfoconstants

Stop nur neu setzen wenn Distanz zum Kurs > StopLevel ist.

--- Leopold ---


Alle Zeitangaben in WEZ +2. Es ist jetzt 22:07 Uhr.

Powered by vBulletin® Version 3.8.5 (Deutsch)
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.6.1
Powered by vBCMS® 2.7.0 ©2002 - 2024 vbdesigns.de
Copyright ©2009 - 2023 by Expert-Advisor.com - Das Metatrader Forum