May you please help me and tell me if the following script will allow me to create a study that generates a sell order after the stock price has increased 10% from the market open at 9:30:00 a.m.?
Is "aggregationperiod.day" the best way to specify the market open at 9:30:00 a.m.? Thank you very much for your time and your help.
Is "aggregationperiod.day" the best way to specify the market open at 9:30:00 a.m.? Thank you very much for your time and your help.
Code:
input offsetType = {default percent, value, tick};
input target = 0.1;
input aggregationperiod = aggregationperiod.day;
def entryprice = open(period = aggregationperiod);
def mult;
switch (offsetType) {
case percent:
mult = entryPrice / 100;
case value:
mult = 1;
case tick:
mult = tickSize();
}
def targetPrice = entryPrice + target * mult;
plot sell = high >= targetPrice;