Отправлено 24 October 2010 - 20:15
потестил входы по стоху и машкам, на разных броках работает по разному:
if (TradeNow && total<1){
// double PrevCl = iClose(Symbol(),0,2);
// double CurrCl = iClose(Symbol(),0,1);
double MA11 = iMA(NULL,0,fast,0,MODE_EMA, PRICE_CLOSE,0);
double MA12 = iMA(NULL,0,fast,0,MODE_EMA, PRICE_CLOSE,1);
double MA21 = iMA(NULL,0,slow,0,MODE_EMA, PRICE_CLOSE,0);
double MA22 = iMA(NULL,0,slow,0,MODE_EMA, PRICE_CLOSE,1);
double Stoch1 = iStochastic(NULL,0,PeriodsK,PeriodsD,PeriodsSmoothD,MODE_EMA,PRICE_CLOSE,MODE_MAIN,1);
double Stoch2 = iStochastic(NULL,0,PeriodsK,PeriodsD,PeriodsSmoothD,MODE_EMA,PRICE_CLOSE,MODE_MAIN,2);
double ma1 = iStochastic(NULL,0,PeriodsK,PeriodsD,PeriodsSmoothD,MODE_EMA,PRICE_CLOSE,MODE_SIGNAL,1);
double ma2 = iStochastic(NULL,0,PeriodsK,PeriodsD,PeriodsSmoothD,MODE_EMA,PRICE_CLOSE,MODE_SIGNAL,2);
//if( Stoch1 > ma1 && Stoch2 < ma2 && Stoch1 < LowLevel )
//{
// EnterLong = true;
//}
//else if ( Stoch1 < ma1 && Stoch2 > ma2 && Stoch1 > HighLevel)
//{
// EnterShort = true;
//}
SellLimit = Bid;
BuyLimit = Ask;
if(!ShortTrade && !LongTrade){
NumOfTrades = total;
// if(PrevCl < CurrCl){
// if( MA11 > MA21 && MA12 < MA22 ) { //&& Stoch1 < HighLevel) {
if( Stoch1 > ma1 && Stoch2 < ma2 && Stoch1 < LowLevel ) {