Hey! I want some help with an entry code. It should go long if the last 5 bars have dropped x number of points.
I have searched here on the forum but can not find anything.
There you go:
X = 150 * pipsize
Diff = close - close[4]
If Diff >= X then
Buy at market
Endif
replace 150 with the number of pips that best suit you.
Thank you Roberto – very useful piece of code
Tested it with trailing. Had some strange entrys.
Entries are perfect, you can append this line to your code to easily spot signals in the variable windows that is opened by ProBackTest:
graph Diff >= X
your IF at line 7 is a bit weird, as it is mot closed until the end (with the very last ENDIF), thus leaving your Trailing Stop idle most of the time. I suggest that you move the very last ENDIF to line 12, unless this behaviour is intentional.
I suggest that you move the very last ENDIF to line 12
When i do this, then the result became worst