DonLincolnUts
New member
Hello
Below is the Study code DailyOpen() which comes with TOS Studies, and draws a line at the opening price of the day for any stock.
How can this be turned in to a strategy so that the strategy will ONLY buy the stock when the price goes above DailyOpen. Attached is a sample picture when the stock stayed lower and then came back up and went above opening price.
input aggregationPeriod = AggregationPeriod.DAY;
input showOnlyLastPeriod = yes;
def prevPrice = open(period = aggregationPeriod)[-1];
def price = open(period = aggregationPeriod);
plot DailyOpen = if showOnlyLastPeriod and !IsNaN(prevPrice) then Double.NaN else price;
DailyOpen.SetDefaultColor(GetColor(2));
DailyOpen.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
When I place this order it shows the area where condition is true, but the order never fills and just follows the price
BUY +10 HEPA MKT MARK WHEN HEPA STUDY 'close > DailyOpen()
Below is the Study code DailyOpen() which comes with TOS Studies, and draws a line at the opening price of the day for any stock.
How can this be turned in to a strategy so that the strategy will ONLY buy the stock when the price goes above DailyOpen. Attached is a sample picture when the stock stayed lower and then came back up and went above opening price.
input aggregationPeriod = AggregationPeriod.DAY;
input showOnlyLastPeriod = yes;
def prevPrice = open(period = aggregationPeriod)[-1];
def price = open(period = aggregationPeriod);
plot DailyOpen = if showOnlyLastPeriod and !IsNaN(prevPrice) then Double.NaN else price;
DailyOpen.SetDefaultColor(GetColor(2));
DailyOpen.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
When I place this order it shows the area where condition is true, but the order never fills and just follows the price
BUY +10 HEPA MKT MARK WHEN HEPA STUDY 'close > DailyOpen()
Last edited: