PDA

View Full Version : trailing stop using external function


gawdib
5th February 2004, 11:00 PM
I find it easy to write a trailing stop if I write it under the exit trigger part, however I still cannot understand the manual that I have read many times carfully about

the Fast Trailing Stop External Function, extfml("tradesim.trailing stop")

The text of the separate article ON TRAILING STOPS states: "The indicator above generates a trailing stop band on the long side. An exit condition is generated on the day

when the low of the day crosses the stop band of the following day. " But how does it know to exit if the FOLLLOWING day has not yet happened?

.: ExtFml("TradeSim.TrailingStop", { 1. Name of external function } Mode, { 2. Mode} TradePosition, { 3. Trade Position Type } { 4. Volatility Function } RefPoint { 5.

Reference Point } ThresholdPoint { 6. Threshold Point }.parts 1-4 are easy to understand It is 5 and 6 that i cannot figure out how to begin. Yes, you give an example :
BandLong:=ExtFml( "TradeSim.TrailingStop", BAND, LONG, Volatility, CLOSE, LOW);

But i cannot figure out what close the formula is referring to. ThE close on the day of the entry trigger? the highest close SINCE the entry trigger? OR ????some other

close?

thE MANUAL STATES " The RefERENCEPoint parameter determines the point or price where the trailing stop is calculated. It is typically set to the closing price however it

could be set to HIGH for the long side or to LOW for the short side."

sO THE MANUAL DOES NOT SAY WHICH CLOSE IS BEING REFERRED TO. cOULD YOU please BE so kind as to tell me? thank you very much. Geoffrey

David Samborsky
7th February 2004, 03:22 AM
The trailing stop is recalculated for each bar so the closing price refers to closing price of the current bar.

It is analogous to the price array used in the trailing stop used in the formula language .ie X denotes the reference point when calculating the trailing stop using the following expressions.

Stop:=X-ARC*ATR(Period); {long side}

Stop:=X+ARC*ATR(Period); {short side}