Gamestudio Links
Zorro Links
Newest Posts
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
LPDIRECT3DCUBETEXTUR
E9

by Ayumi. 04/12/24 11:00
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 04/11/24 14:56
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (firecrest, AndrewAMD), 387 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
11honza11, ccorrea, sakolin, rajesh7827, juergen_wue
19045 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Pause trailing stop in TMF #486915
11/15/22 14:06
11/15/22 14:06
Joined: Sep 2022
Posts: 8
Hout Bay
J
jacqu Offline OP
Newbie
jacqu  Offline OP
Newbie
J

Joined: Sep 2022
Posts: 8
Hout Bay
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.
Re: Pause trailing stop in TMF [Re: jacqu] #486920
11/16/22 09:37
11/16/22 09:37
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
Automatic trailing is activated with the Trail variable. It is stored in TradeTrailDiff, so for disabling the trailing, set TradeTrailDiff to 0. Or do not use automatic trailing at all and trail by script in the TMF.


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1