Magic Number - Is there any use?
In MT4, using magic can sort out which position is sent by which EA and managed independently.
But in MT5, all are merged into one position so is there any use for magic number?
if( PositionSelect("EURCHF")==true &&PositionGetInteger(POSITION_TYPE)==POSITION_TYPE_BUY && PositionGetInteger(POSITION_MAGIC)==123231 && PositionGetDouble(POSITION_VOLUME)==loturus+2 ) { double asalz2 = PositionGetDouble(POSITION_PRICE_OPEN); double currentz2 = PositionGetDouble(POSITION_PRICE_CURRENT); if(asalz2-currentz2>300*Poin) { fBuyL3(); } } if( PositionSelect("EURCHF")==true &&PositionGetInteger(POSITION_TYPE)==POSITION_TYPE_BUY && PositionGetInteger(POSITION_MAGIC)==878763 && PositionGetDouble(POSITION_VOLUME)==loturus+3 ) { double asalz3 = PositionGetDouble(POSITION_PRICE_OPEN); double currentz3 = PositionGetDouble(POSITION_PRICE_CURRENT); if(asalz3-currentz3>300*Poin) { fBuyL4(); } }
In MT4, using magic can sort out which position is sent by which EA and managed independently.
But in MT5, all are merged into one position so is there any use for magic number?
https://www.mql5.com/en/forum/15482
The Use of ORDER_MAGIC for Trading with Different Expert Advisors on a Single Instrument
The Optimal Method for Calculation of Total Position Volume by Specified Magic Number
- www.mql5.com
In MT4, using magic can sort out which position is sent by which EA and managed independently.
But in MT5, all are merged into one position so is there any use for magic number?