Regarding the following:
ApplyStop(stopTypeTrailing, stopModePercent, .0001, 1, False, 0, 0, -1, activationfloor=2);
I can't find much documentation on what the 'activation floor' means. Does it mean that a 2% trailing stop will kick in only after the price has risen 2% from the buyprice?
Thanks for any help.
@C_M, check the ReleaseNotes.html file in the Amibroker folder.
CHANGES FOR VERSION 6.25.0 (as compared to 6.22.0)
AFL: ApplyStop now has 8th argument: ActivationFloor that defines the amount of profit (in dollars or percents, according to stopmode) that must be exceeded before stop is activated
The same document, elsewhere, also states:
Docs: updated documentation on ApplyStop to include activationFloor
but, unfortunately, this seems not the case for the ApplyStop() function documentation (let's hint @Tomasz to check it - by the way it seems to me that this should be the 9th argument.).
Anyway, I suggest to review also this past thread and this one
I assume one would need to use it in conjunction with
ApplyStop(stopTypeLoss, stopModePercent, 2);
to take care of the situation where the price moves down immediately after buying?
Would be nice to have it in a single line. Like a fixed stop that becomes a trailing stop after x points/$/percent.
@beppe, could you help me understand why this simple trailing stop code will sometimes exit at the same price as the buyprice on the next bar? I checked the settings carefully and thought they were correct.
SetPositionSize ( 1,spsShares);
SetOption( "FuturesMode", True);
SetOption( "AllowSameBarExit", false);
SetBacktestMode( backtestRegularRaw);//multi );
BuyPrice = sellPrice = C;
s = ROC(C,1)>0;
Buy = s AND Ref(s,-1) AND Ref(s,-2);
Sell = false;
ApplyStop(stopTypeTrailing, stopModePoint, 2, ExitAtStop = 1 );
This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.