hi apprentice
this works well to protect the margin but maybe one final tweak? in metatrader the automation will allow a reverse trade to place if it has no impact on the set free margin value but will prevent all trades from placing if it calculates it will take it over the minimum set margin amount.
here all trades cease once the minimal margin value is reached
is it possible to continue to allow those that don't alter the free margin value?
jen