
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
So you can safely remove the check for the mode of margin calculation ENUM_ACCOUNT_MARGIN_MODE)AccountInfoInteger(ACCOUNT_MARGIN_MODE), the Expert Advisor will work for all three modes of margin calculation.
ACCOUNT_MARGIN_MODE_RETAIL_HEDGING: Used for OTC market with independent position accounting ("hedging", there can be multiple positions on one symbol).
ACCOUNT_MARGIN_MODE_RETAIL_NETTING: Used for OTC market when accounting positions in "netting" mode (one symbol can be only one position).
ACCOUNT_MARGIN_MODE_EXCHANGE : Used for MOEX exchange market.
However, for the exchange market you will need to add rounding to the whole number of lots, because fractional lots do not work there.
So let him add it, as long as the advisor closes the position in one direction first before opening it in the opposite direction.
:) It's hard when both people are very nimble and push the keys :)
There is a forum on trading, automated trading systems and trading strategies testing
Expert Advisor Ivan - the best of ilan
Vladimir Karputov, 2017.03.28 15:47
Set "Use averaging" == false and "Ivan" EA will not add position.
Although... Even if it will add a position afterwards (when the signal reverses) it will close completely. You may try it.
So you can safely remove the check for the margin calculation mode ENUM_ACCOUNT_MARGIN_MODE)AccountInfoInteger(ACCOUNT_MARGIN_MODE), the Expert Advisor will work for all three modes of margin calculation.
ACCOUNT_MARGIN_MODE_RETAIL_HEDGING: Used for OTC market with independent position accounting ("hedging", there can be multiple positions on one symbol).
ACCOUNT_MARGIN_MODE_RETAIL_NETTING: Used for OTC market when accounting positions in "netting" mode (one symbol can be only one position).
ACCOUNT_MARGIN_MODE_EXCHANGE : Used for MOEX exchange market.
However, for the stock market, you will need to add rounding to the whole number of lots, i.e. fractional lots do not work there.
I'm not going to remove it yet - I've got netting undigestibility for some time. But lot calculation is automatic (void OpenBuy() and void OpenSell()). Now I'll check it on RTS futures...
Added. Lot is calculated correctly, but you need to manually correct the risk percentage (increase) - otherwise it may turn out that the calculated lot is equal to zero.
version "1.010".
Added parameter "Break-even": Break-even ("0" - do not use Break-even).
Example: I set him a task, when a certain price is reached, to make a buy/sell-Set a stop/stop/stack. At a certain bounce/pierce, move stop/stack to a given level
Example: I set him a task, when a certain price is reached, to make a buy/sell-Set a stop/stop/stack. On a certain bounce/pierce, move stop/stack to a given level
Search in CodeBase ?
version "1.010".
Added parameter "Break-even": Break-even ("0" - do not use Break-even).
Compile errors. EA probably not combining with newest MT5 version
Compile errors
You quoted a post from 2017. A lot has changed since then. This is old code.
You quoted a post from 2017. A lot has changed since then. This is old code.
Alright :)