Experts: HedgeCover EA

 

HedgeCover EA:

Intelligent position protection with one-hedge-per-position logic. Features magic number separation, cooldown timer, and max hedges limit. Prevents infinite hedging loops. Free MIT license.

Author: Lupus Materia

 

Thank you Lupus , Very interesting idea and implementation , This is the code I use if I want something to run only in the tester, not sure its appropriate for you .

if(MQLInfoInteger(MQL_TESTER)){ 
   if(PositionsTotal() == 0) {
      m_trade.Sell(0.1, _Symbol, 0, 0, 0, "Test Position");
      Print("Opened test BUY position for hedging simulation");
   }
} 

Improperly formatted code edited by moderator. Please always use the CODE button (Alt-S) when inserting code.

Code button in editor