Hi,
I am trying to code this logic (essentially an X day range switch indicator)
1. Buy when close of today is higher than highs of last X days
2. Sell when close of today is lower than low of last X days
This indicator will always be in trade. I have coded it in MS as an expert advisor. Problem is, I get multiple buy signals one after another when price is moving up on a day-to-day basis.
I need to only signal a buy when this condition occurs for the first time (change in bias from short position). Thereafter it is in buy mode until #2 occurs (change in bias from long position).
Vice-versa for sell trades
Couldn't figure out how to do it in MS. I know its possible because I have a password protected implementation of this indicator. I am trying to improve on this system.
Any help will be appreciated
Thanks in advance
Nitin
I am trying to code this logic (essentially an X day range switch indicator)
1. Buy when close of today is higher than highs of last X days
2. Sell when close of today is lower than low of last X days
This indicator will always be in trade. I have coded it in MS as an expert advisor. Problem is, I get multiple buy signals one after another when price is moving up on a day-to-day basis.
I need to only signal a buy when this condition occurs for the first time (change in bias from short position). Thereafter it is in buy mode until #2 occurs (change in bias from long position).
Vice-versa for sell trades
Couldn't figure out how to do it in MS. I know its possible because I have a password protected implementation of this indicator. I am trying to improve on this system.
Any help will be appreciated
Thanks in advance
Nitin