Так как я не программист. Помогите запрограммировать индикатор. Вот формула:
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
Для авторизации и пользования сайтом MQL5.com необходимо разрешить использование файлов Сookie.
Пожалуйста, включите в вашем браузере данную настройку, иначе вы не сможете авторизоваться.
Вы вошли в аккаунт. Двухфакторная аутентификация отключена. Настройте её заново и отсканируйте новый QR-код или продолжите с отключённой двухфакторной аутентификацией.
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