Re-entry delay

Questions about MultiCharts and user contributed studies.
no erocla
Posts: 134
Joined: 31 May 2013
Has thanked: 60 times
Been thanked: 7 times

Re-entry delay

Postby no erocla » 04 Apr 2019

I've some difficult to set a re-entry delay, to fix a reentry after a stoploss.

Code: Select all

IF marketposition() = 0 and stoptrigger = false and ...... then begin
StopLoss = c * ((100-sl)/100);
I'm coding stoploss as follow:

Code: Select all

if marketposition() = 1 then
SELL ( "StopLoss" ) 1 contracts next bar at StopLoss stop;
and i try to count bar after StopLoss trigger as follow:

Code: Select all

if (L < StopLoss ) THEN stoptrigger = true;
if (stoptrigger = true) then count= count+1;
if count > 2 then begin
count = 0;
stoptrigger = false;
end;
Any help will be appreciated
No Erocla

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Re-entry delay

Postby Henry MultiСharts » 05 Apr 2019

Hello no erocla,

You may find the BarsSinceExit command useful.

User avatar
syswizard
Posts: 295
Joined: 15 Dec 2012
Has thanked: 16 times
Been thanked: 28 times

Re: Re-entry delay

Postby syswizard » 19 Apr 2019

Dude - why are you reinventing the wheel ?
Use this:
SetPercentTrailing
Closes out the entire position or the entry if the specified percentage of the
maximum profit is lost after the profit has reached the specified value; generates
the appropriate Stop order depending on whether the position is long or short.
For example, if the specified profit is ¤100 and the specified percentage is 50, and
the profit has reached the maximum of ¤120, the position will be closed once the
profit falls back to ¤60.

no erocla
Posts: 134
Joined: 31 May 2013
Has thanked: 60 times
Been thanked: 7 times

Re: Re-entry delay

Postby no erocla » 13 Sep 2019

Dude - why are you reinventing the wheel ?
Use this:
SetPercentTrailing
Closes out the entire position or the entry if the specified percentage of the
maximum profit is lost after the profit has reached the specified value; generates
the appropriate Stop order depending on whether the position is long or short.
For example, if the specified profit is ¤100 and the specified percentage is 50, and
the profit has reached the maximum of ¤120, the position will be closed once the
profit falls back to ¤60.
im not talking about trailing stop.


Return to “MultiCharts”