Discussions
»
Product and Service Development
»
Formula Assistance
»
setting price stops when an indicator triggers [RESOLVED]
Rank: Advanced Member
Groups: Registered, Registered Users Joined: 8/22/2005(UTC) Posts: 30
|
I'd like to be able to set a sell stop above 2 pips of the price high whenever a sell signal is triggered from an indicator.
Jose Silva's web site www.metastocktools.com has an excellent snippet of code "pip detector" that returns the minimum pip for a security. It's useful for just this function: - set the stop when the current bar's high exceeds the last bar's high by more than 2 pips,
H > (ref(h,-1))+((2* Fml("pip dedector"))))
If I use the valuewhen function, in place of (ref(h,-1) I can find the price high when the indicator most recently triggered. However, this would limit my ability to backtest.
I'd like to be able to set an exit rule in my expert, or within a custom indicator that uses a "two pip" stop whenever the indicator was triggered. is that possible?
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users Joined: 8/22/2005(UTC) Posts: 30
|
duh - major brain cramp
IF statement should do the trick
IF(fml = 1, H,0) then add the 2 pips from Jose's pip detector - which I am still most impressed with -
|
|
|
|
Users browsing this topic |
Guest (Hidden)
|
Discussions
»
Product and Service Development
»
Formula Assistance
»
setting price stops when an indicator triggers [RESOLVED]
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.