Abend.
Seit einiger Zeit ist in meinem EA irgendwie voll der Wurm drin. Egal, wie ich die Öffnungs-Bedingungen schreibe und anordne, er öffnet entweder gar nix oder jede Order zig mal.
Komisch ist, dass ne ähnliche Form in nem anderen EA einwandfrei funktioniert. Allerdings werden da nur Stop-Orders raus geschickt.
Code:
//=============================================================================================================
// P R U E F E N O B O R D E R S G E O E F F N E T S I N D
//=============================================================================================================
for(i=OrdersTotal()-1;i>=0;i--){
if(OrderSelect(i,SELECT_BY_POS)){
if(OrderType()==OP_BUY&&OrderMagicNumber()==Buy_Market_MN&&OrderSymbol()==Symbol())bool Buy_Mark_inv=true;
if(OrderType()==OP_SELL&&OrderMagicNumber()==Sell_Market_MN&&OrderSymbol()==Symbol())bool Sel_Mark_inv=true;}}
//=============================================================================================================
// O P E N O R D E R S
//=============================================================================================================
if( SPR_AL==true && RT==true && Fast_TF==Slow_TF && Buy_Mark_inv==false && Sel_Mark_inv==false){
if(Buy_Market==true){
if(CP_1>F_MA&&F_MA>S_MA)OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,Buy_Mark_SL,Buy_Mark_TP,Buy_Market_MN,0,MediumBlue);}
if(Sell_Market==true){
if(CP_1<F_MA&&F_MA<S_MA)OrderSend(Symbol(),OP_SELL,Lots,Bid,Slippage,Sel_Mark_SL,Sel_Mark_TP,Sell_Market_MN,0,SteelBlue); } }