return different numbers of margin for opening 1 lot
You are obviously comparing on different terminals )) Above is MT4, below is MT5. So servers are different, trading conditions are different. The simplest thing is different leverage.
My EA uses a multi-step search for an entry point, for this it first checks the history for signals from the start, then works in real time. So in the strategy tester, everything works fine with the history, but when I run it in real time, it does not properly scan the history and misses signals, what could be the problem?
Maybe there is an obvious answer, because the code fragment is quite big to post here, so I am not giving the code yet.
My EA uses a multi-step search for entry points, for this it first checks the history for signals from the start, then works in real time. So in the strategy tester, everything works fine with the history, but when I run it in real time, it does not properly scan the history and misses signals, what could be the problem?
Maybe there is an obvious answer, because the code fragment is quite big to post here, so I am not giving the code yet.
Do the debugging piece by piece. Separate the history scan into the script. Output detailed information with Alert(): first the number of bars in the history, the start and end date, ... and then the process of scanning. It may be more convenient to write it all to a file
STARIJ: Do the debugging step by step. Separate the history scan into a script. Output using Alert() the detailed information: first of all, the number of bars in the history, the start and the end date, ... and then the process of scanning. It may be more convenient to write it all to a file
Thanks for the tip, I will read how to do it.
I have one more question, when I run real-time debugging, Metatrader4 always runs it on CHF, does anybody know what to adjust to make it run on the pair I need?
It was the indicator values for other timeframes which apparently are not considered in the tester. I also found the way to make the right pair. Thanks for your participation )
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Hi!
Can someone suggest an analogue of replacement of MaxLotCheck() from MT5 for MT4, thanks
There is no function itself. You have to write your own. With all the checks it should fit in 10-20 lines.
There is no function itself. You have to write your own. With all the checks, it should fit in 10-20 lines.
OK, but the formula itself?
OK, but here's the formula itself?
Let's look at the source:
ENUM_ORDER_TYPE and OrderCalcMargin need to be replaced here.Still not clear....
margin = MarketInfo(Symbol(), MODE_MARGINREQUIRED)
и
double margin;
OrderCalcMargin(ORDER_TYPE_BUY,Symbol(),1.0,SymbolInfoDouble(Symbol(),SYMBOL_ASK),margin);
return different numbers of margin to open 1 lot
Still not clear....
margin = MarketInfo(Symbol(), MODE_MARGINREQUIRED)
и
double margin;
OrderCalcMargin(ORDER_TYPE_BUY,Symbol(),1.0,SymbolInfoDouble(Symbol(),SYMBOL_ASK),margin);
return different numbers of margin for opening 1 lot
You are obviously comparing on different terminals )) Above is MT4, below is MT5. So servers are different, trading conditions are different. The simplest thing is different leverage.
What did you actually get, what were the values?
Yes, that's right, the leverage is different, on one 1/300, on the other 1/2000
thanks
Hi all!
My EA uses a multi-step search for an entry point, for this it first checks the history for signals from the start, then works in real time. So in the strategy tester, everything works fine with the history, but when I run it in real time, it does not properly scan the history and misses signals, what could be the problem?
Maybe there is an obvious answer, because the code fragment is quite big to post here, so I am not giving the code yet.
Hi all!
My EA uses a multi-step search for entry points, for this it first checks the history for signals from the start, then works in real time. So in the strategy tester, everything works fine with the history, but when I run it in real time, it does not properly scan the history and misses signals, what could be the problem?
Maybe there is an obvious answer, because the code fragment is quite big to post here, so I am not giving the code yet.
Do the debugging step by step. Separate the history scan into a script. Output using Alert() the detailed information: first of all, the number of bars in the history, the start and the end date, ... and then the process of scanning. It may be more convenient to write it all to a file
Thanks for the tip, I will read how to do it.
I have one more question, when I run real-time debugging, Metatrader4 always runs it on CHF, does anybody know what to adjust to make it run on the pair I need?
It was the indicator values for other timeframes which apparently are not considered in the tester. I also found the way to make the right pair. Thanks for your participation )