Questions from Beginners MQL4 MT4 MetaTrader 4 - page 133

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
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 )