• LIMITED TIME ONLY: Take $40 off VIP with code: BTD40.

Price at date


New member
Hey guys

I am trying get this to buy and/or sell when price crosses above the close of a specific date and sell when price closes below that same specific date.. this is what i ahve so far.

def priceAtDate = if GetYYYYMMDD() == 20210901 then close else Double.NaN;
plot scan = priceAtDate;

input price = close;

AddOrder(OrderType.BUY_AUTO, price >(PaintingStrategy.ARROW_UP), tickcolor = GetColor(6), arrowcolor = GetColor(6));
AddOrder(OrderType.SELL_AUTO, price < (PaintingStrategy.ARROW_UP), tickcolor = GetColor(5), arrowcolor = GetColor(5));

Similar threads