Tradescript logic in "Bearish Red Hanging man (Short Trade)" expert advisor

Hi,

I cant seem to understand the buy and sell script logic in "Bearish Red Hanging man (Short Trade)" expert advisor.

In short trade we sell first and then buy so keeping this in mind

Sell script:

SET A = CLOSE-LOW
SET B = OPEN-CLOSE
SET C = HIGH-OPEN
TREND(CLOSE,10)=UP
A>=10*B
AND C/B<1
AND REF(CLOSE,1)<REF(OPEN,1) AND
OPEN<REF(CLOSE,1)

Here we sell when a pattern is formed. (I understood this script)

Buy script:

REF (CLOSE, 1) > REF (OPEN,1) AND
REF(CLOSE,2) > REF(OPEN,2)

We buy when past two days candles are green after formation of hanging man?

why is that? shouldn't we go with S&R?

Also, does PI support any other language/script other than tradescript. I can do C.

Thank You!


This is a single candlestick pattern. A buy signal is generated when a paper umbrella is seen at the bottom end of the rally.