Minute Data is now working for Me with this build. Thanks Guys.
|
After looking at the pdf I made a few changes to the code.
They use a 40 period ATR. Their stop NEVER gets reset.
They use more data than We can,and They adjust for dividends,etc.
You can increase your data to max in "Settings > Data Manager".
The original code would reset the stop after a stop was hit.
That may work if you trade shorter term.
Add indicator - Average True Range Period 40 to chart.
Add realcode RULE with this code:
'# ATR = indicator.AverageTrueRange
Static RatchetStop As Single
Static RatchetStop1 As Single
If isfirstbar Then
RatchetStop = 0
RatchetStop1 = 0
End If
RatchetStop1 = RatchetStop
If CurrentIndex > 40 Then
If Price.Close - (10 * ATR.value) > RatchetStop Then
RatchetStop = Price.Close - (10 * ATR.value)
End If
If price.Close < RatchetStop AndAlso price.Close(1) > RatchetStop1 Then
pass
End If
End If
Indicator
'# ATR = indicator.AverageTrueRange
Static RatchetStop As Single
If isfirstbar Then
RatchetStop = 0
End If
If CurrentIndex > 14 Then
If Price.Close - (10 * ATR.value) > RatchetStop Then
RatchetStop = Price.Close - (10 * ATR.value)
End If
plot = RatchetStop
End IF
|
Not familiar with ATR ratchet stops, but here's My stab at it.
Add indicator - Average True Range Period 14 to chart.
Add realcode RULE with this code:
'# ATR = indicator.AverageTrueRange
Static RatchetStop As Single
If isfirstbar Then
RatchetStop = 0
End If
If CurrentIndex > 14 Then
If Price.Close - (10 * ATR.value) > RatchetStop Then
RatchetStop = Price.Close - (10 * ATR.value)
End If
If price.Close < RatchetStop Then
RatchetStop = 0
pass
End If
End If
To see where the stop is, Add INDICATOR with this code:
'# ATR = indicator.AverageTrueRange
Static RatchetStop As Single
If isfirstbar Then
RatchetStop = 0
End If
If CurrentIndex > 14 Then
If Price.Close - (10 * ATR.value) > RatchetStop Then
RatchetStop = Price.Close - (10 * ATR.value)
End If
If price.Close < RatchetStop Then
RatchetStop = 0
End If
plot = RatchetStop
End IF
Left click indicator and check "Show last indicator value"
|
How can I see My watchlists for stockfinder in telechart?
I can see my watchlists for telechart in stockfinder.
Thanks.
|
How can I see My watchlists for stockfinder in telechart?
I can see my watchlists for telechart in stockfinder.
Thanks.
|