06.12.19
|
Elite Mitglied
|
|
Registriert seit: Sep 2015
Beiträge: 1.178
|
|
Danke für Deine Arbeit. Aber SL und TP funktionieren eigentlich korrekt.
Das Problem scheint der Stochastic Indikator/Oszillator wie auch immer zu sein. Mit dem stimmt irgendwas nicht. Das ist doch eigentlich Alles richtig.
Code:
extern string STOCH="Stochastic Oscillator";
extern int Stoch_indicator_min=0; // unten
extern int Stoch_indicator_max=100; // oben
extern double Stoch_IL_1=13.0; // unten
extern double Stoch_IL_2=87.0; // oben
extern int Stoch_K_Period=5;
extern int Stoch_D_Period=3;
extern int Stoch_Slowing=3;
input ENUM_MA_METHOD Stoch_MA_Method=MODE_SMA;
input ENUM_STO_PRICE Stoch_price_field=1;
Code:
//=============================================================================================================
// S T O C H A S T I C D E K L A R A T I O N
//=============================================================================================================
double STO_Ma_B1=iStochastic(Symbol(),Timeframe,Stoch_K_Period,Stoch_D_Period,Stoch_Slowing,Stoch_MA_Method,Stoch_price_field,MODE_MAIN,1);
double STO_Si_B1=iStochastic(Symbol(),Timeframe,Stoch_K_Period,Stoch_D_Period,Stoch_Slowing,Stoch_MA_Method,Stoch_price_field,MODE_SIGNAL,1);
double STO_Ma_B0=iStochastic(Symbol(),Timeframe,Stoch_K_Period,Stoch_D_Period,Stoch_Slowing,Stoch_MA_Method,Stoch_price_field,MODE_MAIN,0);
double STO_Si_B0=iStochastic(Symbol(),Timeframe,Stoch_K_Period,Stoch_D_Period,Stoch_Slowing,Stoch_MA_Method,Stoch_price_field,MODE_SIGNAL,0);
double STO_Ma_B2=iStochastic(Symbol(),Timeframe,Stoch_K_Period,Stoch_D_Period,Stoch_Slowing,Stoch_MA_Method,Stoch_price_field,MODE_MAIN,2);
double STO_Si_B2=iStochastic(Symbol(),Timeframe,Stoch_K_Period,Stoch_D_Period,Stoch_Slowing,Stoch_MA_Method,Stoch_price_field,MODE_SIGNAL,2);
Code:
if(RT==true && SPR_AL==true && IsInv==false){
// unten unten unten
if(open_Buy==true&& STO_Ma_B0>STO_Si_B0 && STO_Ma_B1>STO_Si_B1 && STO_Si_B1>Stoch_IL_1 && STO_Ma_B2 < STO_Si_B2 && WPR_B0>WPR_IL_2 && WPR_B1>WPR_IL_2 ){
if(IsTradeAllowed()==true)Ti=OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,Buy_SL,Buy_TP,NULL,Buy_MN,0,Beige);
return(Ti); }
// oben oben oben
if(open_Sell==true&& STO_Ma_B0<STO_Si_B0 && STO_Ma_B1<STO_Si_B1 && STO_Si_B1<Stoch_IL_2 && STO_Ma_B2 > STO_Si_B2 && WPR_B0<WPR_IL_1 && WPR_B1<WPR_IL_1 ){
if(IsTradeAllowed()==true)Ti=OrderSend(Symbol(),OP_SELL,Lots,Bid,Slippage,Sel_SL,Sel_TP,NULL,Sell_MN,0,Blue);
return(Ti); } }
|