Ребят,, помогите ревеснуть сигналы с каждого индика... грид свб...
нужно сделать чтоб можно было выбирать какой сигнал можно реверснуть..
нужно сделать чтоб можно было выбирать какой сигнал можно реверснуть..
int f0_7() { //int signal()
int buy = 1, sell = -1;
if (!Use_SWB_indicator) {
double ld_0 = iSAR(NULL, SignalPeriod, gd_1036, gd_1044, 0);
double ld_8 = iMA(NULL, SignalPeriod, gi_1020, gi_1024, gi_1028, gi_1032, 0);
if (ld_0 > ld_8) return (sell);
if (ld_0 < ld_8) return (buy);
return (0);}
////////////// 0.2b Signal from SWB Grid 4.1.0.7 //////////////////////
double upBB=iBands(Symbol(),0,bb_period,bb_deviation,0,bb_upprice, bb_upmode,bb_shift);
double loBB=iBands(Symbol(),0,bb_period,bb_deviation,0,bb_loprice, bb_lomode,bb_shift);
double stoch=iStochastic(Symbol(),0,k,d,slowing,sto_MA,price_field,sto_mode,stoch_shift);
double rsi=iRSI(Symbol(),0,rsi_period,rsi_price,rsi_shift);
if(use_bb && use_stoch && use_rsi)
{
if(High[bb_shift]>upBB && stoch>up_level && rsi>upper) return(sell);
if(Low[bb_shift]<loBB && stoch<lo_level && rsi<lower) return(buy);
}
if(use_bb && use_stoch && !use_rsi)
{
if(High[bb_shift]>upBB && stoch>up_level) return(sell);
if(Low[bb_shift]<loBB && stoch<lo_level) return(buy);
}
if(use_bb && !use_stoch && !use_rsi)
{
if(High[bb_shift]>upBB) return(sell);
if(Low[bb_shift]<loBB) return(buy);
}
if(!use_bb && use_stoch && use_rsi)
{
if(stoch>up_level && rsi>upper) return(sell);
if(stoch<lo_level && rsi<lower) return(buy);
}
if(!use_bb && use_stoch && !use_rsi)
{
if(stoch>up_level) return(sell);
if(stoch<lo_level) return(buy);
}
if(use_bb && !use_stoch && use_rsi)
{
if(High[bb_shift]>upBB && rsi>upper) return(sell);
if(Low[bb_shift]<loBB && rsi<lower) return(buy);
}
if(!use_bb && !use_stoch && use_rsi)
{
if(rsi>upper) return(sell);
if(rsi<lower) return(buy);
}
return(0);
}
int buy = 1, sell = -1;
if (!Use_SWB_indicator) {
double ld_0 = iSAR(NULL, SignalPeriod, gd_1036, gd_1044, 0);
double ld_8 = iMA(NULL, SignalPeriod, gi_1020, gi_1024, gi_1028, gi_1032, 0);
if (ld_0 > ld_8) return (sell);
if (ld_0 < ld_8) return (buy);
return (0);}
////////////// 0.2b Signal from SWB Grid 4.1.0.7 //////////////////////
double upBB=iBands(Symbol(),0,bb_period,bb_deviation,0,bb_upprice, bb_upmode,bb_shift);
double loBB=iBands(Symbol(),0,bb_period,bb_deviation,0,bb_loprice, bb_lomode,bb_shift);
double stoch=iStochastic(Symbol(),0,k,d,slowing,sto_MA,price_field,sto_mode,stoch_shift);
double rsi=iRSI(Symbol(),0,rsi_period,rsi_price,rsi_shift);
if(use_bb && use_stoch && use_rsi)
{
if(High[bb_shift]>upBB && stoch>up_level && rsi>upper) return(sell);
if(Low[bb_shift]<loBB && stoch<lo_level && rsi<lower) return(buy);
}
if(use_bb && use_stoch && !use_rsi)
{
if(High[bb_shift]>upBB && stoch>up_level) return(sell);
if(Low[bb_shift]<loBB && stoch<lo_level) return(buy);
}
if(use_bb && !use_stoch && !use_rsi)
{
if(High[bb_shift]>upBB) return(sell);
if(Low[bb_shift]<loBB) return(buy);
}
if(!use_bb && use_stoch && use_rsi)
{
if(stoch>up_level && rsi>upper) return(sell);
if(stoch<lo_level && rsi<lower) return(buy);
}
if(!use_bb && use_stoch && !use_rsi)
{
if(stoch>up_level) return(sell);
if(stoch<lo_level) return(buy);
}
if(use_bb && !use_stoch && use_rsi)
{
if(High[bb_shift]>upBB && rsi>upper) return(sell);
if(Low[bb_shift]<loBB && rsi<lower) return(buy);
}
if(!use_bb && !use_stoch && use_rsi)
{
if(rsi>upper) return(sell);
if(rsi<lower) return(buy);
}
return(0);
}
Последнее редактирование: