Experts: Dematus

 

Dematus:

Increasing a position volume. Entry signal by iDeMarker (DeMarker, DeM) indicator. Regular trailing and trailing by equity.

If there is a position, and the price moved from the last position open price (stored in the m_last_deal_price_IN internal variable) for the specified Distance, while iDeMarker (DeMarker, DeM) indicator gives the permission, open a position having the volume of Coefficient Lots positions * volume of the last open position (stored in the internal m_lot variable). If there are currently no positions, we expect the permission from the indicator and open with the Lots volume.

Stop loss (the Stop Loss parameter) is 999 points by default so that it is almost never activated :), there is no take profit in the settings. If positions are present, a usual trailing can be applied to them (Trailing Stop and Trailing Step).

Trailing considering available funds is managed by Trailing Equity, Virtual Stop Equity and Trailing Start Equity variables.

Author: Vladimir Karputov

 

Hello Vladimir:

Excellent EA thanks for sharing.

I have a question regarding m_lot variable.  In live trading conditions the VPS service can reboot and load again EA without you want to do that.

If there is an open order and already transaction add in place then m_lot will already be different from starting Inplot value, but reboot or reload EA will reset m_lot again to starting value Inplot.

Is there a way to change code in order the EA can remember where m_lot variable was before the reboot?  Do you have another EA that can do something similar? that is remember value for variables?

Thanks you in advance

 
Eduardo Linares :

Hello Vladimir:

Excellent EA thanks for sharing.

I have a question regarding m_lot variable.  In live trading conditions the VPS service can reboot and load again EA without you want to do that.

If there is an open order and already transaction add in place then m_lot will already be different from starting Inplot value, but reboot or reload EA will reset m_lot again to starting value Inplot.

Is there a way to change code in order the EA can remember where m_lot variable was before the reboot?  Do you have another EA that can do something similar? that is remember value for variables?

Thanks you in advance

You can add any protection. This is open source.

 

yes for sure but I am only starting to learn MT5 coding.

Can you point me to some code to add that protection or similar?

by the way I am not a seller, just want to learn MT5 and experiment with code.

thanks

 
Eduardo Linares :

yes for sure but I am only starting to learn MT5 coding.

Can you point me to some code to add that protection or similar?

by the way I am not a seller, just want to learn MT5 and experiment with code.

thanks

You can apply two options:

  1. Write to file
  2. Global terminal variable
 

Great !! thanks

I will try something with Global Variables of the Terminal to see what happens

Reason: