Dear Pete,
Great fan of your work. I’m a newbie to TOS platform (new to trading too).
I’ve watched your videos multiple times and almost went through all the TOS categories in this forum.
I have taken code from one of your replies from the Strategy section and created a scan (& a watchlist) based on it.
<strong><em>Strategy code:</em></strong>
--------------------------------------------------------------------------------------------------------------------
def haclose = (open + high + low + close) / 4;
def haopen = compoundValue(1, (haopen[1] + haclose[1]) / 2, (open[1] + close[1]) / 2);
def Yesterday_haclose = (open from 1 bar ago + high from 1 bar ago + low from 1 bar ago + close from 1 bar ago) / 4 ;
def Yesterday_haopen = compoundValue(1, (Yesterday_haopen[1] + Yesterday_haclose[1]) / 2, (open[1] + close[1]) / 2);
def buy = Yesterday_haclose < Yesterday_haopen and haopen < haclose;
def sell = Yesterday_haclose > Yesterday_haopen and haopen > haclose;
AddOrder(OrderType.BUY_AUTO, buy, tickcolor = Color.GREEN, arrowcolor = Color.GREEN, name = “Buy”);
AddOrder(OrderType.SELL_AUTO, sell, tickcolor = Color.RED, arrowcolor = Color.RED, name = “Sell”);
——————————————————————————————————————–
<strong><em>Scan code:</em></strong>
——————————————————————————————————————–
def haclose = (open + high + low + close) / 4;
def haopen = compoundValue(1, (haopen[1] + haclose[1]) / 2, (open[1] + close[1]) / 2);
def Yesterday_haclose = (open from 1 bar ago + high from 1 bar ago + low from 1 bar ago + close from 1 bar ago) / 4 ;
def Yesterday_haopen = compoundValue(1, (Yesterday_haopen[1] + Yesterday_haclose[1]) / 2, (open[1] + close[1]) / 2);
plot habuy = Yesterday_haopen;
——————————————————————————————————————–
I was wondering if it is possible to find in the scan (and thereby in the watchlist) the first buy signal from the strategy code.
The results I get are very inconsistent.
Appreciate your valuable guidance.
Regards,
Jay
Like this:
Like Loading...