masonbarnard
New member
Hello,
I trade a strategy that involves shorting the Open, Covering at the previous day close with a stop loss that is 1/3rd the price target above open... I currently have a horizonal line for previous day close and current days open, but can't figure out how to add a line for the stop, which is a pretty simple formula based on those two lines...
stopline = Open price + (open-previousdayclose / 3)
- say a stock gaps up from $3(previous day close) to $6(open), the stop loss would be at $7.... 6+(6-3/31)
---- This is what i have for previous day close and open price, but dont know how to add the formula
input time = 930;
input price = open;
rec time_value = If(SecondsTillTime(time) == 0, price, time_value[1]);
plot open = If(time_value == 0, Double.NaN, time_value);
input aggregationPeriod = AggregationPeriod.DAY;
input length = 1;
input displace = -1;
input showOnlyLastPeriod = no;
plot PrevDayClose;
if showOnlyLastPeriod and !IsNaN(close(period = aggregationPeriod)[-1]) {
PrevDayClose = Double.NaN;
} else {
PrevDayClose = Highest(close(period = aggregationPeriod)[-displace], length);
}
PrevDayClose.SetDefaultColor(GetColor(9));
PrevDayClose.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
I trade a strategy that involves shorting the Open, Covering at the previous day close with a stop loss that is 1/3rd the price target above open... I currently have a horizonal line for previous day close and current days open, but can't figure out how to add a line for the stop, which is a pretty simple formula based on those two lines...
stopline = Open price + (open-previousdayclose / 3)
- say a stock gaps up from $3(previous day close) to $6(open), the stop loss would be at $7.... 6+(6-3/31)
---- This is what i have for previous day close and open price, but dont know how to add the formula
input time = 930;
input price = open;
rec time_value = If(SecondsTillTime(time) == 0, price, time_value[1]);
plot open = If(time_value == 0, Double.NaN, time_value);
input aggregationPeriod = AggregationPeriod.DAY;
input length = 1;
input displace = -1;
input showOnlyLastPeriod = no;
plot PrevDayClose;
if showOnlyLastPeriod and !IsNaN(close(period = aggregationPeriod)[-1]) {
PrevDayClose = Double.NaN;
} else {
PrevDayClose = Highest(close(period = aggregationPeriod)[-displace], length);
}
PrevDayClose.SetDefaultColor(GetColor(9));
PrevDayClose.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);