[Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2. - page 153

 
buroff:

Found "ForexSession" indicator, but time parameters had to be changed. LocalGMT=3 - Moscow, BrokerGMT=0 - London, and I changed start and end times of sessions too.

But nothing works with America - I added block "void ShowSessionBroker()" - to add 30 minutes to New York, after compilation an error appears, and I don't have enough mind to fix it.

Good people, can you tell me what i did wrong and how to fix it?

I had it compiled normally.
 
Sergey_Rogozin:


Sps, why is there a 1 at the end but a 0??? If the RSI value is to be compared to the previous one, should it be written like this?
double RSI = iRSI(NULL,0,14,PRICE_CLOSE,2);
 
Vovo4ka:

I wonder why I put 1 at the end and 0 at the end, and if I want to compare the value of RSI with the previous value, then I have to write it that way?

You are free to set the number of any bar. All that matters is which bar you want the double RSI value on.

For comparison, of course, you must have at least two values, i.e. values on different bars.

 
Sergey_Rogozin:
You are free to set the number of any bar. All that matters is which bar you want the double RSI value on.

For example, if I want to compare the current RSI value with the previous closing price, then I can do this...
double RSI1 = iRSI(NULL,0,14,PRICE_CLOSE,1);
double RSI2 = iRSI(NULL,0,14,PRICE_CLOSE,2);
and then we compare... right?
 
Vovo4ka:

Let's say I want to compare the current RSI value with the previous closing price, then it goes like this... and then we compare... right?
Exactly right. With one correction: the current bar is zero.
 
Sergey_Rogozin:
You can set the number of any bar. It only matters which bar you want to get the value of double RSI.


I can also tell you how to make the signal open one trade... because it opens trades on all the bars... ((((

If the signal would open only one deal.... at the repeat one more and it does not matter if the previous one was closed....

something like this...))

 

You need to check for already open orders before opening an order.

You will need a small/non-complex function,

which will allow or disallow you to enter the market if there is a signal to do so.

 
Sergey_Rogozin:

You need to check for already open orders before opening an order.

You will need a small/uncomplicated function,

which will allow or disallow you to enter the market even if there is a signal to do so.


can you suggest..... by any chance?? to insert .... otherwise I can't really evaluate the advisor...((
 
Vovo4ka:

Would you happen to suggest.....?? to put .... otherwise I can't really evaluate the EA this way...((
The function looks like this
  bool Exist(){
     for(int cnt=OrdersTotal()-1; cnt>=0; cnt--){
        if(OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES)){
          if(OrderMagicNumber()==Magic){
            if(OrderSymbol()==Symbol()){
              if(OrderType()<2)return(true);
      } } } }        
  return(false);} 

That is, if there are open positions, the function will detect them and return true.

Your task is to put something like this before OrderSend(.......):

if(!Exist() && Signal)OrderSend(Symbol()........);
где Signal - Ваш сигнал на вход в рынок.
 

Can you please tell me how to check the validity of an order? For example, I have a pending order in place and need to check if it has triggered a stop order.


bool check=OrderChek(ticket);

Comment("The order with the ticket ", ticket, "does not exist (triggered)");


I can't find how to do this.

Reason: