Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 268

 

For what reason in MQL4 can iRSI() return zero?

Arguments have been checked 100 times for correctness.

 
Alexander Fedosov: For what reason in MQL4 can iRSI() produce zero?
show me the minimum code that gives this result. I got 0 when I set period = 1
 
Good afternoon. Can you please tell me how to make sure that orders are not reopened after closing on profit?
 
STARIJ:
Show me the minimum code that gives this result
You should have uploaded the history. Otherwise iRSI gives zero
 
Alexander Fedosov:
You should have uploaded the history. Otherwise iRSI gives out zero
Please tell me how to upload the history. And what does it mean. I have a thousand bars in history in my settings. Is it correct?
 
STARIJ:
Can you tell me how to upload a story? And what does it mean. I have a thousand bars in the history in the settings. Is it correct?
Just open a trading instrument.
 
Alexander Fedosov:
Just open a trading instrument.
did you have it closed? Was the chart with this instrument missing?
 
Lowech:
Good afternoon. Can you please tell me how to make orders not to reopen after closing on profit?
  bool x;
  static bool Флаг=0;
  if(!Сигнал) Флаг=true;
  else if(Флаг)
  {
    x=OrderSend(...);

Флаг=false; }

Something like that? Or to open it on the profit?
 
STARIJ:
Anything special? Or just a profit?
I do not understand it (how to implement it in an EA), can´t you prescribe anything simpler? If there is no signal change and the order has already been closed, then it should not open again until the signal changes.
 
Lowech:
I cannot figure it out (how to implement it in an EA), is there nothing easier to prescribe? If there is no change in the signal and the order has already been closed, then it should not open again until the signal has changed.
  1. There is a signal to open a Buy position, for example.
  2. Find in the order history the most recently closed trade.
  3. see its type,
    1. If it is Sell, you can open Buy ----> return(ORDER_TYPE_BUY);
    2. if it is a Buy, then
  4. see what kind of profit this Buy position was closed with.
    1. If it is negative, we can open a Buy ----> return(ORDER_TYPE_BUY);
    2. If it is positive, we cannot open a new Buy ----> return(WRONG_VALUE);
Reason: