Moin.
Im Großen und Ganzen scheinen SL und TP zu funktionieren.
Allerdings kommt bei EURNZD im Journal immer die Meldung invalid S/L or T/P
"2018.06.05 11:03:15.674 '1694254': order sell 0.01 EURNZD opening at market sl: 1.66283 tp: 1.66220 failed [Invalid S/L or T/P]"
"2018.06.05 11:03:15.565 '1694254': order sell market 0.01 EURNZD sl: 1.66283 tp: 1.66220"
"2018.06.05 11:03:15.565 '1694254': order buy 0.01 EURNZD opening at market sl: 1.66261 tp: 1.66324 failed [Invalid S/L or T/P]"
"2018.06.05 11:03:15.455 '1694254': order buy market 0.01 EURNZD sl: 1.66261 tp: 1.66324"
Wenn ich hier auch nach _Point normen will kommt irgendwie immer "wrong parameters count" oder so.
Code:
double M_CA=NormalizeDouble(MarketInfo(Symbol(),MODE_ASK),_Digits);
double M_CB=NormalizeDouble(MarketInfo(Symbol(),MODE_BID),_Digits);
Stimmt bei der Spread Berechnung was nicht?
Code:
double SPR=NormalizeDouble(M_CA-M_CB*_Point,_Digits);
Beim Max Spread bool vielleicht nicht?
Code:
//Max Spread Bedingungen
if(Only_MS_Allowed==false)bool SPR_AL=true;//bool SPR_AL = Spread Allowed
if(Only_MS_Allowed==true){
double M_SPR=NormalizeDouble(Max_Spread*_Point,_Digits);//Max Spread
if(SPR<=NormalizeDouble(Max_Spread*_Point,_Digits))SPR_AL=true;}
Code:
//Normaler SL
if(Stoploss>0&&Auto_Stoploss==false)double B_SL=NormalizeDouble(M_CA-Stoploss*_Point,_Digits);//einfacher Buy SL, der bei Open Buy gesendet werden soll.
if(Stoploss>0&&Auto_Stoploss==false)double S_SL=NormalizeDouble(M_CB+Stoploss*_Point,_Digits);//einfacher Sell SL, der bei Open Sell gesendet werden soll.
//Normaler TP
if(Takeprofit>0&&Auto_Takeprofit==false)double B_TP=NormalizeDouble(M_CA+Takeprofit*_Point,_Digits);//einfacher Buy TP, der bei Open Buy gesendet werden soll.
if(Takeprofit>0&&Auto_Takeprofit==false)double S_TP=NormalizeDouble(M_CB-Takeprofit*_Point,_Digits);//einfacher Sell TP, der bei Open Buy gesendet werden soll.
Hab wirklich keine Ahnung warum er nicht richtig funktioniert.