Re: Problems with this study August 08, 2018 06:30AM |
Registered: 5 years ago Posts: 23 |
Re: ADD ALERTS August 08, 2018 01:20PM |
Registered: 7 years ago Posts: 126 |
Alert(Crosses(close, TH, CrossingDirection.ABOVE), "Target high crossed",alert.bar,Sound.Ring); Alert(Crosses(close, TL, CrossingDirection.BELOW), "Target low crossed",alert.bar,Sound.Ring);
Re: Fun with ThinkScript August 09, 2018 03:29AM |
Registered: 7 years ago Posts: 126 |
Quote
NMR
I've started with this- but am at a loss to figure out how I put in the angle- I was thinking of only 5 or 10 angles worth of a move:
#hint: Plots the tangent angle of the inputted average declare lower; input length = 9;#hint length:The number agg-bars of the average input price = close;#hint Price:The price choice being evaluated for lack of interest of the requester the rest of the code is removed
thinkscript formula for adding the netchange August 09, 2018 12:06PM |
Registered: 5 years ago Posts: 1 |
Re: Centered Moving Average (CMA) August 12, 2018 09:54PM |
Registered: 5 years ago Posts: 11 |
MetaTrader Convesion August 12, 2018 09:58PM |
Registered: 5 years ago Posts: 11 |
Re: MetaTrader Convesion August 13, 2018 06:38AM |
Registered: 7 years ago Posts: 126 |
Quote
chillic15
Below is a script for the ALMA and seeing if anyone can convert it from meta to TOS.
script ALMA { input Data = close; input Window = 9; input Sigma = 6; input Offset = 0.85; def m = (Offset * (Window - 1)); def s = Window/Sigma; def SumVectorData = fold y = 0 to Window with WS do WS + Exp(-(sqr(y-m))/(2*sqr(s))) * getvalue(Data, (Window-1)-y); def SumVector = fold z = 0 to Window with CW do CW + Exp(-(sqr(z-m))/(2*sqr(s))); plot ALMA = SumVectorData / SumVector; } input price=close; input Window = 9; input Sigma = 6; input Offset = 0.85; plot ALMA = ALMA (price, Window, Sigma, Offset); ALMA.setPaintingStrategy(PaintingStrategy.LINE); ALMA.SetDefaultColor(Color.CYAN); ALMA.HideTitle(); ALMA.HideBubble();
Re: MetaTrader Convesion August 13, 2018 07:40AM |
Registered: 5 years ago Posts: 11 |
Re: MetaTrader Convesion August 13, 2018 02:23PM |
Registered: 7 years ago Posts: 126 |
Quote
chillic15
I should of been more clear on my first post.
Re: MetaTrader Convesion August 13, 2018 03:12PM |
Registered: 5 years ago Posts: 11 |
Re: MetaTrader Convesion August 14, 2018 02:02PM |
Registered: 7 years ago Posts: 126 |
# Alma MA with multiple time frames # in the settings "current" represents the current time frame of the chart # by Rigel, August 2018 # script ALMA { input Data = close; input Window = 9; input Sigma = 6; input Offset = 0.85; def m = (Offset * (Window - 1)); def s = Window / Sigma; def SumVectorData = fold y = 0 to Window with WS do WS + Exp(-(Sqr(y - m)) / (2 * Sqr(s))) * GetValue(Data, (Window - 1) - y); def SumVector = fold z = 0 to Window with CW do CW + Exp(-(Sqr(z - m)) / (2 * Sqr(s))); plot ALMA = SumVectorData / SumVector; } input Window = 9; input Sigma = 6; input Offset = 0.85; input TimeFrame= {default current,"2 min","3 min","5 min","10 min","15 min"}; def agg; switch (timeFrame) { case "2 min": agg=aggregationPeriod.TWO_MIN; case "3 min": agg=aggregationPeriod.THREE_MIN; case "5 min": agg=aggregationPeriod.FIVE_MIN; case "10 min": agg=aggregationPeriod.TEN_MIN; case "15 min": agg=aggregationPeriod.FIFTEEN_MIN; case current: agg=getAggregationPeriod(); } plot ALMA = ALMA (close(period=agg), Window, Sigma, Offset); ALMA.SetPaintingStrategy(PaintingStrategy.LINE); #ALMA.SetDefaultColor(Color.CYAN); ALMA.HideTitle(); ALMA.HideBubble();
Re: MetaTrader Convesion August 14, 2018 09:28PM |
Registered: 5 years ago Posts: 11 |
Re: Fun with ThinkScript August 15, 2018 05:03AM |
Registered: 5 years ago Posts: 6 |
Re: On Balance Volume August 15, 2018 05:43AM |
Registered: 5 years ago Posts: 6 |
Re: Fun with ThinkScript August 16, 2018 11:48AM |
Registered: 7 years ago Posts: 126 |
Quote
MoneyBags
I am having a hard time creating a scan from the code below you created to let me know what stocks have a Green signal and another scan for stocks with a Red signal
Re: Fun with ThinkScript August 16, 2018 04:04PM |
Registered: 5 years ago Posts: 6 |
Re: On Balance Volume August 20, 2018 04:14AM |
Registered: 7 years ago Posts: 126 |
Quote
MoneyBags
I wanted to know if you can add a 14 Exponential moving average to the lower study On Balance Volume indicator you created.
plot ema14=expAverage(obv_osc,14); ema14.SetDefaultColor(color.white);
Re: Fun with ThinkScript August 20, 2018 09:04PM |
Registered: 6 years ago Posts: 32 |
Re: Fun with ThinkScript August 21, 2018 10:07AM |
Registered: 11 years ago Posts: 119 |
Re: Assign Price Color when conditions have been met. August 26, 2018 08:55AM |
Registered: 5 years ago Posts: 11 |
Re: Assign Price Color when conditions have been met. August 27, 2018 07:55AM |
Registered: 7 years ago Posts: 126 |
Quote
chillc15
Close is above MA1 and MA1 is above MA2 and MA2 is above MA3 color.GREEN and then obviously the reverse and then yellow when conditions have not been met.
def uptrend=close>MA1 and MA1>MA2 and MA2>MA3 ; [your other conditions] AssignPriceColor(if uptrend then Color.GREEN else if downtrend...... ) ;
Re: Assign Price Color when conditions have been met. August 27, 2018 09:27PM |
Registered: 8 years ago Posts: 59 |
Re: Assign Price Color when conditions have been met. August 30, 2018 07:29AM |
Registered: 5 years ago Posts: 11 |
Re: Fun with ThinkScript August 30, 2018 01:09PM |
Registered: 5 years ago Posts: 6 |
Re: Fun with ThinkScript August 31, 2018 05:31AM |
Registered: 7 years ago Posts: 126 |
Re: Fun with ThinkScript August 31, 2018 09:00AM |
Registered: 5 years ago Posts: 6 |
Re: Fun with ThinkScript September 01, 2018 04:45AM |
Registered: 7 years ago Posts: 126 |
Re: Fun with ThinkScript September 03, 2018 10:33AM |
Registered: 5 years ago Posts: 1 |
Re: Fun with ThinkScript September 04, 2018 12:53AM |
Registered: 5 years ago Posts: 6 |
Re: Fun with ThinkScript September 04, 2018 02:25PM |
Registered: 7 years ago Posts: 126 |
# Plot the high and low of X days ago # Don't know the author of original code to give proper credit # Basic code modified to produce similar results to Robert Payne's solution # by Rigel April 2018 # declare upper; input LastBubble = No; Input DaysAgo = 1;#hint DaysAgo: Excludes today def AdjDaysAgo = DaysAgo + 1;#Adjusted to match a true LastDate which includes today def day = GetDay(); def lastDay = GetLastDay(); def year = GetYear(); def lastYear = GetLastYear(); def yyyymmdd = GetYYYYMMDD(); def agg=aggregationPeriod.DAY; def D_lastDate = HighestAll( if day == lastDay and year == lastYear then yyyymmdd else Double.NaN ); def D_currentDate = if yyyymmdd < D_lastDate then yyyymmdd else D_lastDate; def B_previousDay = if CountTradingDays( D_currentDate, D_lastDate ) == AdjDaysAgo then yes else no; def D_BeginRange= if CountTradingDays( D_currentDate, D_lastDate ) == AdjDaysAgo then yyyymmdd else double.nan; def D_cond= highestall( D_BeginRange); def PH = HighestAll( if B_previousDay then high( period = agg ) else Double.NaN ); def PL = HighestAll( if B_previousDay then low( period = agg ) else Double.NaN ); plot previoushigh= if yyyymmdd>= D_cond then PH else double.NaN; plot previouslow= if yyyymmdd>= D_cond then PL else double.NaN; addlabel(yes,"last date "+D_lastDate,color.white); #================ Look & Feel ============= PreviousHigh.SetDefaultColor( Color.green ); PreviousHigh.SetLineWeight( 2 ); PreviousHigh.HideBubble(); PreviousLow.SetDefaultColor( Color.red); PreviousLow.SetLineWeight( 2 ); PreviousLow.HideBubble(); #=========== ID Bubbles =================== Def barnum = barnumber(); def FirstBar = if barNum == 1 then 1 else 0; #========= Last ID bubbles ========== Input Offset = -10; def LastBar = !IsNaN(open) and IsNaN(open [-1] ) ; Def BubbleLocation = LastBar[Offset]; addchartbubble(BubbleLocation && LastBubble, PreviousHigh, ("High of " + DaysAgo + " day(s) ago" ), color.white); addchartbubble(BubbleLocation && LastBubble,PreviousLow, ("Low of " + DaysAgo + " day(s) ago" ), color.white);