Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 454

 
artmedia70:

Are you testing on AUDUSD ?

The calculated price values in your trade order should be normalized to Digits. Not only that, but it should meet the StopLevel requirements (didn't do it here)

OrderMagicNumber() is the magic number of a pre-selected order. You should either set it as a specific value, or calculate it in the EA, so that it would be unique for it.

Prior to that check unprint all values of all conditions that are checked here. Then it will be clear to you where to look.



Yes, testing on AUDUSD

OrderSend("AUDUSD",OP_BUY,Lot,Ask,slippage,Ask-SL*Point,0,NULL,OrderMagicNumber(),0,Green);-this line worked in the tester without any problems, until we added the conditions

like

iOpen("AUDJPY",PERIOD_M1,1)>iClose("AUDJPY",PERIOD_M1,1)...

I repeat that everything works on the account... not in the tester...

 
All...sorted...was missing the quote history...AUDJPY-referred to as a minor))) Thanks a lot everyone!
 
niktron:

OrderSend("AUDUSD",OP_BUY,Lot,Ask,slippage,Ask-SL*Point,0,NULL,OrderMagicNumber(),0,Green);-this line worked in the tester without problems, until the conditions were added

About this string I have already written to you. Then, when you get errors 130 do not ask what the problem is.
 
artmedia70:
I have already written to you about this line. Then when error 130 comes up, don't ask me what the problem is.


Soerror 130 may not occur for a long time and then it will happen?
 
If anyone has encountered a code to calculate equity drawdown (absolute and relative), please give me a link.
 
Leo59:
If anyone has encountered a code to calculate equity drawdown (absolute and relative), please give me a link.
When I needed it, I searched, but did not find it, because I needed not in the past, as in the tester, but in the future, putting SL on an open position to anticipate the possible drawdown, if the position will close on SL, displaying the data in the comment on the chart, which I did, and it became very convenient to see all the possible trouble in advance, as I wish you! At the same time, having done it myself, I learned a lot, which is more valuable. Good luck to you!
 
TarasBY:
Already written.

Great, thank you very much for this material, it will now be much more effective in limiting losses and increasing profits.
 
niktron:

i.e. error 130 may not happen for a long time, but then it will?
I am not a telepath, nor am I Nostradamus. I can't tell you exactly when error 130 will appear. But I can tell you that it will appear. Until you normalize all calculated prices in the trade orders and check the sl and tp prices in the trade order to see if they are correct relative to the StopLevel requirements of your brokerage company, you will get the 130th error.
 

There is such a function code. In MT4 beta, when compiling it, I get "expression not boolean" warning in lines marked with an arrow. Can you suggest how to fix it?

void WindowCaptions()
{
  int hwnd = GetAncestor(WindowHandle(Symbol(),Period()),1); 

  int ret = GetWindowLongA( hwnd, GWL_STYLE );
  if (ret & WS_MAXIMIZE) return;                                               //<---
  if (ret & WS_DLGFRAME) ret -= WS_DLGFRAME; else ret += WS_DLGFRAME;          //<---

  //это если совсем без рамочек 
  // if (ret & WS_THICKFRAME) ret -= WS_THICKFRAME; else ret += WS_THICKFRAME;
  
  SetWindowLongA( hwnd, GWL_STYLE, ret );
  SetWindowPos ( hwnd, 0,0,0,0,0, 39); 
}
 
pro_:

There is such a function code. In MT4 beta, when compiling it, I get "expression not boolean" warning in lines marked with an arrow. Can you suggest how to fix it?


No, we won't.
Reason: