[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 10

 

UUHH finally free.....

Hello granit77. In previous posts you and I have been working out the condition of the trading function for CCI. Here's what I got.....

//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {
//----
//объявляем переменную cci_0 и присваиваем ей значение индикатора CCI на нулевом (текущем) баре
double cci_0=iCCI(NULL,0, CCIperiod, CCIprice,0);
//объявляем переменную cci_1 и присваиваем ей значение индикатора CCI на первом (предыдущем) баре
double cci_1=iCCI(NULL,0, CCIperiod, CCIprice,1);
//если значение индикатора CCI на нулевом (текущем) баре уже меньше уровня 100
//а предыдущее его значение (на первом баре) было больше уровня 100
//значит произошло пересечение, и мы даем сигнал на продажу
if( cci_0<100 && cci_1>100) SignalSell=true;
     if( CheckOrders(OP_SELL))
      {
       if(!OrderSend(Symbol(), OP_BUY, Lots, Ask, 3, 0, 0, NULL, MagicNumber))
         Print("Не открыт ордер Buy. Ошибка №", GetLastError()); 
       }
       
    if( cci_0>100 && cci_1<100) SignalBUY=true;
     if( CheckOrders(OP_BUY))
      {
       if(!OrderSend(Symbol(), OP_SELL, Lots, Bid, 3, 0, 0, NULL, MagicNumber))
         Print("Не открыт ордер Sell. Ошибка №", GetLastError()); 
       }
 
//----
   return(0);
  }

Did I do everything right? Or again, out of inexperience, got it wrong.......

In this place double cci_1............. cci must be written with a small letter????????

 
igrok2008 >> :

Did I do it right?

I think so...

In this place double cci_1............. cci must be written with a small letter????????

No, you can call it anything you like.

It's just that there are some generally accepted conventions about naming and generally code styles.

One of them is that local variable names are spelled with a small letter.

 
TheXpert >> :

I think so...

No, you can call them whatever you want.

It's just that there are some generally accepted conventions about naming and generally code styles.

One of them is to spell local variable names with a small letter.

OK I get it......

 
I am new to forex. I am working on different ideas. I would like to mechanise the processes.

I set SELLSTOP (with stop loss and Take Profit), after it triggered I put BUYSTOP at same level with loss triggered (i.e. stop reversal).

The problem is I have to sit and wait for SELLSTOP to close, if I reach profit I cancel second order. How can I mechanise this?

If the first order BUYSTOP the same but inversely .

Thank you.

 
It would be interesting to know which, if not a secret, methods a pro uses to filter out the trend from the channel impulse movement (i.e. the trend is not necessary as we filter it out if it is present (in the EA), but if it is not present, it would be very important, i.e. the EA does not work when there is a trend)
 
Dimoncheg писал(а) >>
It is very interesting to know which, if not a secret, methods a pro uses to filter out the trend from the channel impulse movement (i.e. the trend is not necessary in hell, we filter it out if it is present (in the EA), and if it is not present, then it is very important, that is, the EA does not work when there is a trend)

The Damiani_Volt indicator can be used.

 

Hello.

At the beginning of this page, I posted my piece of code (edited with the help of granit77, thanks to him). It was checked by TheXpert, thanks to him too.

BUT.... THE QUESTION is, in the trading condition is it not necessary to specify (for CCI) -100???????????? It says +100, but the indicator itself has a value of -100 and -150

and even reaches -180??????

Now the following.... If we consider the logic of writing a trading condition for CCI, then I have the following for RSI and WPR....

int start()
  {
//----
double rsi_0=iRSI(NULL,0, RSIperiod, RSIprice,0);
double rsi_1=iRSI(NULL,0, RSIperiod, RSIprice,1);

if( rsi_0<100 && rsi_1>100) SignalSell=true;
     if( CheckOrders(OP_SELL))
      {
       if(!OrderSend(Symbol(), OP_BUY, Lots, Ask, 3, 0, 0, NULL, MagicNumber))
         Print("Не открыт ордер Buy. Ошибка №", GetLastError()); 
       }
       
    if( rsi_0>100 && rsi_1<100) SignalBUY=true;
     if( CheckOrders(OP_BUY))
      {
       if(!OrderSend(Symbol(), OP_SELL, Lots, Bid, 3, 0, 0, NULL, MagicNumber))
         Print("Не открыт ордер Sell. Ошибка №", GetLastError()); 
       }
 
//----
   return(0);
  }
 
Excuse me for the RSI values of 70 and 30. And for WRP the following...
int start()
  {
//----
double wpr_0=iWPR(NULL,0, WPRperiod,0);
double wpr_1=iWPR(NULL,0, WPRperiod,1);

if( wpr_0<-80 && wpr_1>-80) SignalSell=true;
     if( CheckOrders(OP_SELL))
      {
       if(!OrderSend(Symbol(), OP_BUY, Lots, Ask, 3, 0, 0, NULL, MagicNumber))
         Print("Не открыт ордер Buy. Ошибка №", GetLastError()); 
       }
       
    if( wpr_0>-20 && wpr_1<-20) SignalBUY=true;
     if( CheckOrders(OP_BUY))
      {
       if(!OrderSend(Symbol(), OP_SELL, Lots, Bid, 3, 0, 0, NULL, MagicNumber))
         Print("Не открыт ордер Sell. Ошибка №", GetLastError()); 
       }
 
//----
   return(0);
  }
Did I enter the correct values for CCI RSI and WRP???????
 
igrok2008 >> :

Why did you take 100 for the rsi level ?

 
satop >> :

Why did you take 100 for the rsi level ?

In the post above, I have corrected myself. Levels 30 70, for WPR 20 and 80