Pls bear with me on this one, whilst I try & explain what I am attempting to do.
I have a simple JMA strategy which enters a trade when 2x different JMAs cross & also when there is a continuation after a pullback.
What I would like to do is limit trade entry to when the price is not close to a key area of support & reistance. i.e.
if (Close[0] + 10 < AreaOfSupport && AreaOfSupport + 10 < Close[0])
then EnterLong().
I have now established indicators (which are basically a number of constant lines with a specific price value associated to each) which can be used for the above purpose.
However, the number of lines I am talking about is > 20 & I was thinking there must be two coding options to execute this:
1/ As above, but repeat that line of code for the different AreasOfSupport & AreasOfResistance ---- laborious.
or.....
2/ If (Close[0] - 10 < AreaOfSupport 1,2,3,4,5,6,7,8, etc && AreaOfSupport 1,2,3,4,5,6,7,8, etc. + 10 < Close[0]
then EnterLong() ---- quicker to code.
Since I have a number of different entry & exit conditions for both long & short then samples '1' or '2' have to be repeated for each of the conditions, hence the preference for Option '2' if this is possible.
Question to NT -> Is option '2' possible to code?
Many thx in advance
David
Comment