Hello!
I was wondering how to code a condition for short: I want the the close to be in the bottom 50% of the total bars range.
Any ideas?
Regards
There you go:
IF close <= (high - (range / 2)) THEN
SELLSHORT AT MARKET
ENDIF
Interesting how one differs from the other. The result is the same but I would write that code snippet this way:
IF close <= low + Range * 0.5 THEN
SELLSHORT AT MARKET
ENDIF
If I want to only sell short if it is in the bottom 10% I merely replace 0.5 with 0.1. This makes it very easy to run optimizations and find out if there is different edge in different percentages.
I’m not saying that one is better than the other, just that there are more ways than one to skin a cat.
/F