' Name: Simplified Larry Williams 3 bar trailing stop
' Purpose: Trailing stop sets a stop value at the lowest low
' (or highest high) over 3 periods before the current day.
' Parameters: Periods: the number of period of lookback
#Stop
#Param "Periods",3
Dim myvalue as single
Dim mystop as single
If signal=longsignal then ' If long signal, calculate
myvalue=LLV(periods)[3] ' lowest low value of last 3 bars
myvalue = MAX(myvalue, 1) ' & chk that todays low is greater
mystop=myvalue
if L<=mystop then ' If stop level is breached
signal=exitsignal ' send exit signal.
end if
Plotprice ("stop",mystop,green) ' Plot the stop in price pane
else if signal= shortsignal then ' If short signal, calculate
myvalue=HHV(periods)[3] ' highest high value of last 3 bars
myvalue=MIN(myvalue,1) ' & check that todays high is lower
mystop=myvalue ' than this
if H>= mystop then ' If stop level is breached
signal=exitsignal ' send exit signal.
end if
Plotprice ("stop",mystop,green) ' Plot the stop in the price pane
end if
- Помогите написать индикатор Meta Trader4
- Кому стратегию? Много и бесплатно)
- Советники: Super Trend Hull EA
круто
Вы упускаете торговые возможности:
- Бесплатные приложения для трейдинга
- 8 000+ сигналов для копирования
- Экономические новости для анализа финансовых рынков
Регистрация
Вход
Вы принимаете политику сайта и условия использования
Если у вас нет учетной записи, зарегистрируйтесь