I have written a simple code to experiment in order to find how to refer to yesterday's candle - I want yesterday's candle to be green. In the code below are 4 comment lines which are the 4 experiments I've tried and what happens. None of them work to exclude red candles yesterday. Thanks for any clues.
SetOption("MaxOpenPositions", 10 );
PositionSize = -10;
PositionScore = RSI();
SetTradeDelays(1,1,1,1);
BuyPrice = Open;
SellPrice = Open;
ShortPrice = 0;
CoverPrice = 0;
Buy =
Low == Open
AND Open < Close
//AND BarsSince ( Open < Close ) == 1; // 1 no hits
//AND BarsSince ( Open < Close ) -1; // 2 lots of hits, but yesterday is both red & green
//AND (Open < Close) - 1; // 3 no hits
//AND (Open < Close) == 1; // 4 lots of hits, but yesterday is both red & green
Sell =
High == Open
AND Close < Open;
Filter = Buy;
AddColumn (RSI(2), "RSI");
SetSortColumns( 3 );