

PeriodIndx = RoundDown(yyyyMmDd / 100, 0) ĭef isPeriodRolled = CompoundValue(1, periodIndx != periodIndx, yes) PeriodIndx = Floor((DaysFromDate(First(yyyyMmDd)) + GetDayOfWeek(First(yyyyMmDd))) / 7) TimeFrame = timeFrame.WEEK and cap >= AggregationPeriod.MONTH Īssert(!errorInAggregation, "timeFrame should be not less than current chart aggregation period") Original © Dreadblitzĭef BBUpper = SimpleMovingAvg(close, BbPeriod) + StDev(close, BbPeriod) * BbDeviations ĭef BBLower = SimpleMovingAvg(close, BbPeriod) - StDev(close, BbPeriod) * BbDeviations ĭef BBSignal = if close > BBUpper then 1 else if close TrendLine then 1 else if TrendLine = AggregationPeriod.WEEK or SlowAvg.SetPaintingStrategy(PaintingStrategy.DASHES) MedAvg.SetPaintingStrategy(PaintingStrategy.DASHES) MedAvg.SetDefaultColor(CreateColor(255, 95, 95)) įastAvg.SetPaintingStrategy(PaintingStrategy.DASHES)

Plot slowAvg = MovingAverage(averageType, price, slowLength) įastAvg.SetDefaultColor(CreateColor(51, 204, 255)) Plot medAvg = MovingAverage(averageType, price, medLength) Plot fastAvg = MovingAverage(averageType, price, fastLength) ", ay) ĪddLabel(Choose_Risk_and_Stop, "No defined size: " + Floor(Round(size)) + " Shares with " + AsDollars(Risk_Amount) + " risk with Stop Loss at " + AsDollars(Stop_Price) + ". ", ay) ĪddLabel(Choose_Size_and_Stop, "No Defined risk: " + Shares + " Shares with " + AsDollars(risk) + " risk with Stop Loss at " + AsDollars(Stop_Price) + ". Input Choose_Risk_and_Stop = yes #can't choose sizeĭef Mark = close(PriceType = PriceType.MARK) ĭef Size = Risk_Amount / (Mark - Stop_Price) ĭef Stop = ((Mark * Shares) - Risk_Amount) / Shares ĪddLabel(yes, "Current Price: " + AsDollars(Mark), ay) ĪddLabel(Choose_Size_and_Risk, "No defined stop: " + Shares + " Shares with " + AsDollars(Risk_Amount) + " risk with Stop Loss at " + AsDollars(stop) + ". Input Choose_Size_and_Stop = yes #can't choose risk Input Choose_Size_and_Risk = yes #can't choose stop #AddLabel(yes, Concat(" The amount of active trader movement = ",Round(Share_Quantity_purchase_limit + close_Position )), Color.white) Priceline.SetPaintingStrategy(PaintingStrategy.line) ĪddLabel(yes, Concat(" Stock price + profit goal = ",Round(current_price + close_Position )), Color.white) Plot priceLine = current_price + close_Position Plot Close_Position = profit_goal/Share_Quantity_purchase_limit Ĭlose_Position.SetDefaultColor(GetColor(0)) ĪddLabel(yes, Concat("profit goal = ", Round(profit_goal)), Color.orange) ĪddLabel(yes, Concat("required price change = ", (Close_Position)), Color.white) ĭef yellow = profit_goal/Share_Quantity_purchase_limit # Assembled by BenTen at ĭef Share_Quantity_purchase_limit = Budget / current_price ĪddLabel(yes, Concat("Shares available for purchase = ", Round(Share_Quantity_purchase_limit)), Color.ORANGE)
