Based on HeikenAshi entry point. Equity curve could be worse.
Thank you Glenn for sharing this code with us. I post the code below for a better comprehension of the strategy:
ONCE Bull = 2
ONCE Bear = 2
ONCE xOpen = 0
xClose = (Open+High+Low+Close)/4
if(barindex>2) then
xOpen = (xOpen[1] + xClose[1])/2
endif
c1 = xClose>xOpen[1]
c2 = xClose<xOpen[1]
IF c1 THEN
Bear = 0
Bull = Bull + 1
if not onmarket then
buy 1 perpoint at market
endif
ELSIF c2 THEN
Bull = 0
Bear = Bear - 1
if not onmarket then
sellshort 1 perpoint at market
endif
ELSE // IF xClose and xOpen are exactly the same value
ENDIF
set target pprofit 20
//set stop ploss 25
IMO, a major problem with the strategy is that there is no stoploss or no closure of any kind (except the 20 points takeprofit) and because you are waiting to be not on market anymore to open a contrarian order. So depending on when you launch the strategy, the order could last forever, waiting for the price to give us our 20 points.. but it can also never happen like in the attached example, sorry for that 🙁