Hi
I need advise on code to pause or temporarily cancel trailing stops in a TMF when I select this option from a Control Panel. The TMF still needs to run as it is also used to "Close all trades", if necessary, also from a Control Panel and also provides TradeProfit info to the Control Panel.

Alternatively is there a way to prevent the TMF from adjusting / modifying stops which I manually adjust or place in MT4?

int eurtmf()
{
if (panelGet(11,4) == "Active Stops")
{
if (TradeIsLong and (TradeProfit/TradeUnits/PIP > 10))
{
TradeStopLimit = max(TradeStopLimit,LL(10));
}
if (TradeIsShort and (TradeProfit/TradeUnits/PIP > 10))
{
TradeStopLimit = min(TradeStopLimit,HH(10));
}
}
else
{
" Some way to pause trailing stops"
}
if((closeAllTrades == 1) or (Close_EUR == 1))
{
if(NumOpenTotal == 0)
{
closeAllTrades = 0;
Close_EUR = 0;
}
else
{
printf("\nClosing Trades!!");
print(TO_PANEL, "\nClosing Trades!!");
Close_EUR = 0;
profiteur = 0;
return 1;
}
}
profiteur = TradeProfit;
return 0;
}


Many thanks, Jacques

Last edited by jacqu; 11/15/22 14:22.