MarketForecast()."Momentum" crosses above MarketForecast()."NearTerm" and MarketForecast()."NearTerm" crosses above MarketForecast()."Intermediate"
MarketForecast()."Momentum" crosses above MarketForecast()."NearTerm"
MarketForecast()."NearTerm" crosses above MarketForecast()."Intermediate"
Instead of a market forecast, is there a way to make this into a forecast of the underlying?Hello Ben 10,
Being new here, I am working on the coding. I followed your code and did replace MarketForecast with my name MarketForecast2 and it gives me an error saying can not find the function
What do I need to do
Thanks for any help
Miami51961
The name is kind of miss leading. This uses the underlying security's price action only so it tell how the security is doing not the entire market. Hope that helps.Instead of a market forecast, is there a way to make this into a forecast of the underlying?
Could you tell me what other conditions work in combination with this scanner? I'm new to working with this program, so I'm just learning.
@GeneHo
Code:Declare Lower; input OverBought = 70; input OverSold = 30; input Middle = 50; plot Momentum = marketForecast(); Momentum.setDefaultColor(color.RED); AddLabel(yes, "Momentum: " + AsText(Momentum, NumberFormat.TWO_DECIMAL_PLACES) + (if marketForecast() > marketForecast()[1] then " rising" else if marketForecast() < marketForecast()[1] then " falling" else ""), color.RED); plot NearTerm = MarketForecast().NearTerm; NearTerm.setDefaultColor(color.BLUE); AddLabel(yes, "Near Term: " + AsText(NearTerm, NumberFormat.TWO_DECIMAL_PLACES) + (if marketForecast().NearTerm > marketForecast().NearTerm[1] then " rising" else if marketForecast().NearTerm < marketForecast().NearTerm[1] then " falling" else ""), color.BLUE); plot IntTerm = MarketForecast().Intermediate; IntTerm.setDefaultColor(createColor(51, 204, 0)); AddLabel(yes, "(IT)-Intermediate Term: " + AsText(IntTerm, NumberFormat.TWO_DECIMAL_PLACES) + (if marketForecast().Intermediate > marketForecast().Intermediate[1] then " rising" else if marketForecast().Intermediate < marketForecast().Intermediate[1] then " falling" else ""),(createColor(51,204,0))); plot OB_line = OverBought; OB_line.setdefaultColor(color.Green); OB_line.setLineWeight(2); plot OS_line = OverSold; OS_line.setdefaultColor(color.Red); OS_line.setLineWeight(2); plot Middle_Line = Middle; Middle_line.setdefaultColor(color.White); Middle_line.setLineWeight(2); plot cluster2=if momentum>overbought && NearTerm>overbought then 100 else if momentum<oversold && NearTerm<oversold then 0 else double.nan; cluster2.setpaintingStrategy(paintingStrategy.POINTS); cluster2.defineColor("bearish", color.yellow); cluster2.defineColor("bullish", color.blue); cluster2.assignValueColor(if !isnaN(cluster2) && cluster2==100 then cluster2.color("bearish")else cluster2.color("bullish")); cluster2.setlineWeight(2); cluster2.hideBubble(); def formingBar2=!isnaN(close)&&isnan(close[-1]); plot zed2=if barNumber()%10 == 0 && !formingBar2 then 0 else double.NaN; zed2.setDefaultColor(color.light_GRAY); zed2.hideBubble(); plot uno2=if barNumber()%10 ==0 && !formingBar2 then 105 else double.nan; uno2.setdefaultColor(color.light_gray); uno2.hidebubble(); AddCloud(0, OS_line, color.Yellow, Color.YELLOW); AddCloud(100, OB_line, color.Green, color.Green); AddCloud(30, Middle_line, color.Red, color.Red); ################################################# input OverBought1 = 80; input OverSold1 = 20; input Middle1 = 50; plot OB_line1 = OverBought1; OB_line.setdefaultColor(color.Green); OB_line.setLineWeight(2); plot OS_line1 = OverSold1; OS_line.setdefaultColor(color.Red); OS_line.setLineWeight(2); plot Middle_Line1 = Middle1; Middle_line.setdefaultColor(color.White); Middle_line.setLineWeight(2); ############### plot cluster=if momentum>overbought1 && NearTerm>overbought1 && intTerm> overbought1 then 100 else if momentum<oversold1 && NearTerm<oversold1 && intTerm<oversold1 then 0 else double.nan; cluster.setpaintingStrategy(paintingStrategy.POINTS); cluster.defineColor("bearish", color.red); cluster.defineColor("bullish", color.green); cluster.assignValueColor(if !isnaN(cluster) && cluster==100 then cluster.color("bearish")else cluster.color("bullish")); cluster.setlineWeight(5); cluster.hideBubble(); def formingBar=!isnaN(close)&&isnan(close[-1]); plot zed=if barNumber()%10 == 0 && !formingBar then 0 else double.NaN; zed.setDefaultColor(color.light_GRAY); zed.hideBubble(); plot uno=if barNumber()%10 ==0 && !formingBar then 105 else double.nan; uno.setdefaultColor(color.light_gray); uno.hidebubble(); ######## def BullCluster = momentum <=20 and intTerm <=20 and Nearterm <=20; def BearCluster = momentum >=80 and intTerm >=80 and Nearterm >=80; #addlabel(yes, "IT*Above 80 - Intrmdt Trade",color.DARK_Green); #addlabel(yes, "IT*Below 80 - Defensive",color.YELLOW); #addlabel(yes, "IT*Below 50 - BEARISH",color.DARK_RED); #addlabel(yes, "IT*Below 20 Then Crosses above 20 - Bullish",Color.UPTICK);
This script is badass. I'm using it with RSI, MACD, and Standard Deviation Channels and it is really helping analysis and forecasting. Thank you.The Advanced Market Forecast indicator is a powerful tool that offers near term trend, intermediate, and momentum oscillator for ThinkorSwim. Similar to RSI and MFI, there will be levels of overbought and oversold. When the stock reaches these levels with the right confirmation, traders can expect a pullback or reversal.
There will be a scanner at the end of this post to help you scan for bullish and bearish signals produced by the Advanced Market Forecast indicator.
Notes:
You can also draw divergences using the blue near term line just like the MACD and RSI indicators.
- Green line = Intermediate Confirmation Signal
- Dark blue = Near term line
- Red = Momentum
thinkScript Code
Rich (BB code):#Name: Dilbert_StanL_MarketForecast_TMF_original #StudyName: Dilbert_StanL_MarketForecast_TMF_original #Description: Replica of Investools MarketForecast study #Author: Dilbert/Stanl/Mobius and assorted others you tried to crack this #Requested By: # Ver Date Auth Change # v2 012817 Dilbert Finally calculate the momentum line correctly. Scale to 100 instead of 200. # TOS.mx Link: # Trading Notes: # Market Forecast # StanL # #hint:<b>Market Forecast</b>modified with upper and lower reversal zones and labels. Is a double-scale version of the original. All plots maintain their relation with 2X scale. declare lower; input ImedLength = 31; # orig std = 31 input MomentumLength = 5; # orig std = 31 input NearLength = 3; # orig std = 3 def c1I = close - lowest(low,ImedLength); def c2I = highest(high,ImedLength) - lowest(low,ImedLength); def FastK_I = c1I / c2I * 100; def c1N = close - lowest(low,NearLength); def c2N = highest(high,NearLength) - lowest(low,NearLength); def FastK_N = c1N / c2N * 100; def c1M = close - lowest(low,MomentumLength); def c2M = highest(high,MomentumLength) - lowest(low,MomentumLength); def FastK_M = c1M / c2M * 100; Plot Intermediate = Average(FastK_I, 5); # = TMF's GreenLine Intermediate.AssignValueColor(color.Green); Intermediate.SetStyle(Curve.FIRM); Intermediate.SetLineWeight(2); Plot NearTerm = Average(FastK_N, 2); # = TMF's BlueLine NearTerm.AssignValueColor(color.Blue); NearTerm.SetStyle(Curve.FIRM); NearTerm.SetLineWeight(1); def Min1 = Min(low, low[1]); def Min2 = Min(min1, Min(low[2], low[3])); def Max1 = Max(high, Max(high[1], Max(high[2], high[3]))); plot momentum = ((close - Min1) / (Max1 - Min2)) * 100; momentum.setDefaultColor(Color.Red); plot bottomline = 0; bottomline.AssignValueColor(color.gray); bottomline.SetStyle(Curve.FIRM); plot topLine = 100; topLine.AssignValueColor(color.gray); topLine.SetStyle(Curve.FIRM); plot UpperRevZone = 80; bottomline.AssignValueColor(color.gray); bottomline.SetStyle(Curve.FIRM); plot LowerRevZone = 20; LowerRevZone.AssignValueColor(color.gray); LowerRevZone.SetStyle(Curve.firm); plot UpLimit = 120; UpLimit.AssignValueColor(color.black); AddCloud(bottomline, LowerRevZone, color.green, Color.green); AddCloud(topLine, UpperRevZone, color.RED, color.red); AddLabel (yes, "Mom(short)", Color.yellow); AddLabel (yes, "Near term", Color.red); AddLabel (yes, "Med term", Color.green); # Below lines are related to a scan # def ClusterHigh = Intermediate >= 80 && NearTerm >= 80 && Momentum >= 80 ; # def ClusterLow = Intermediate <= 20 && NearTerm <= 20 && Momentum <= 20; # plot cluster = if clusterhigh or clusterlow then 1 else 0; #---------- End Of Code ---------------
Shareable Link: https://tos.mx/x1ssTZ
Market Forecast Bullish Scanner
Rich (BB code):MarketForecast()."Momentum" crosses above MarketForecast()."NearTerm" and MarketForecast()."NearTerm" crosses above MarketForecast()."Intermediate"
Market Forecast Bearish Scanner
Rich (BB code):MarketForecast()."Momentum" crosses below MarketForecast()."NearTerm" and MarketForecast()."NearTerm" crosses below MarketForecast()."Intermediate"
Don't forget to replace MarketForecast with the name of your indicator.
From the first glance this study seems good. From the second glance, there are too many false positives. For example take a look at TSLA daily chart on 10/22/21, where all three lines are overbought and one can think about shorting it. However, price moved up until 11/5/22. Maybe there is another approach on how to use this study, which makes it successful? Was that approach backtested? Please share, if there is any. thx
The Advanced Market Forecast indicator is a powerful tool that offers near term trend, intermediate, and momentum oscillator
In answer to your question, the poster does not seem to be saying that the "big orange arrows at the bottom are a bullish signal", He does provide detailed information as to how he is using the study:Hi
I am confused by the big orange arrows at the bottom is that a bullish signal?
I use the Market Forecast Daily, as a Main study for my success in trading. But I dont use the same way it is listed here. I have addition levels that are more Important. the 80 and 20 lines are just a Visual warning for me and dont provide great importance over all. I use a 30 50 70 Line as these are very Important to trend and taking trades. I use a two time frame approach, a daily chart, with a 5minute chart combination. Lets say I see that NG is either close to, or showing a setup on the daily. This Daily setup would be currently, Green Intermediate Line is above the 30 50 70, I then look at the Blue Near line and Red Momo Line, with the Inter Line High which is Bullish, I wait for the red momo and Blue Near to get Oversold under 20 and come back up to break 30 line this is when, I then start looking at the 5min for trade entries, using a REDSAR .01.05 breakout, and 30High/Low Breaking the High. and staying above it till a GoldSAR .02 .20 is Broken, Once the Daily setup starts I keep taken trades based on the 5min till it no longer breaks out, and or the Daily Red& Blue Lines get up to the 70 to 80 line, then I wait for another daily setup. I trade all Futures this way, and stocks. I have been doing it this way for years. I would Like to see if I can get it a Little more automated though.
I have some code I found a while back that uses the MF Info and provide Vertical lines for it, it is Not exactly how I want it but it is close.
Code:############################################################################################## # aaa_BVZ_MFC_Clusters_on_Chart - 8/21/2018 Developed by G. Horschman ([email protected]) ############################################################################################## # This script will work on any chart. However, it was designed to work in conjunction # with the Market Scholars Mkt Forecast Posture Script. It can be used to display # and identify the following signals on the chart: # # a) Mkt Forecast Bullish and Bearish Clusters # b) Mkt Forecast Intermediate Confirmation Signals # c) Stochastic overbought and oversold signals - K=7,D=3 periods work really well. # A bullish oversold up-arrow will appear when the "K" line crosses up through the # "D" line and the "K" line is below the oversold level (25). A bearish overbought # down-arrow will appear when the "K" line crossed down through the "D" line and # the "K" line is above the overbought level. # d) Mkt Forecast Posture in a chart label. # e) 10 day EMA trend changes # # The script can also be used with alert signals to look for conditional setups. All # indicators can easily be turned or off at will, as what may be appropriate for one symbol # may not be suitable for others. I would Like to see the above script draw a Vertical Line it already does this I would like it a little different, based off of the MF Blue Near and RED momo Lines breaking the 30 displaying a Green Vertical Line and or the Blue Near and Red momo breaking down through the 70 to produce a Red Vertical line. It would be Much better if it could display these or separate lines that could be turned on/off when Green Intermediate Line was either in a Positive trend (above 30 50 70 from a Below 20 condition) or a Negative trend (Below 70 50 30 off of a above 80 condition) alerts would also be Great. [/QUOTE]
What is REDSAR?I use the Market Forecast Daily, as a Main study for my success in trading. But I dont use the same way it is listed here. I have addition levels that are more Important. the 80 and 20 lines are just a Visual warning for me and dont provide great importance over all. I use a 30 50 70 Line as these are very Important to trend and taking trades. I use a two time frame approach, a daily chart, with a 5minute chart combination. Lets say I see that NG is either close to, or showing a setup on the daily. This Daily setup would be currently, Green Intermediate Line is above the 30 50 70, I then look at the Blue Near line and Red Momo Line, with the Inter Line High which is Bullish, I wait for the red momo and Blue Near to get Oversold under 20 and come back up to break 30 line this is when, I then start looking at the 5min for trade entries, using a REDSAR .01.05 breakout, and 30High/Low Breaking the High. and staying above it till a GoldSAR .02 .20 is Broken, Once the Daily setup starts I keep taken trades based on the 5min till it no longer breaks out, and or the Daily Red& Blue Lines get up to the 70 to 80 line, then I wait for another daily setup. I trade all Futures this way, and stocks. I have been doing it this way for years. I would Like to see if I can get it a Little more automated though.
I have some code I found a while back that uses the MF Info and provide Vertical lines for it, it is Not exactly how I want it but it is close.
Code:############################################################################################## # aaa_BVZ_MFC_Clusters_on_Chart - 8/21/2018 Developed by G. Horschman ([email protected]) ############################################################################################## # This script will work on any chart. However, it was designed to work in conjunction # with the Market Scholars Mkt Forecast Posture Script. It can be used to display # and identify the following signals on the chart: # # a) Mkt Forecast Bullish and Bearish Clusters # b) Mkt Forecast Intermediate Confirmation Signals # c) Stochastic overbought and oversold signals - K=7,D=3 periods work really well. # A bullish oversold up-arrow will appear when the "K" line crosses up through the # "D" line and the "K" line is below the oversold level (25). A bearish overbought # down-arrow will appear when the "K" line crossed down through the "D" line and # the "K" line is above the overbought level. # d) Mkt Forecast Posture in a chart label. # e) 10 day EMA trend changes # # The script can also be used with alert signals to look for conditional setups. All # indicators can easily be turned or off at will, as what may be appropriate for one symbol # may not be suitable for others. DefineGlobalColor("UpArrow", CreateColor(35, 255, 106)); DefineGlobalColor("DownArrow", CreateColor(255, 14, 20)); input ShowIntermediateConfirms = yes; input ShowMfcClusters = yes; input ShowStoArrows = yes; input ShowIntermediateLabel = no; input Show10DayMovingAvg = no; def price = close; def MA30 = SimpleMovingAvg(price = close, length = 30); def EMA_10day = ExpAverage(close, length = 10); def MFC = reference MarketForecast.intermediate; def MFCRising = if MFC >= MFC[1] then 1 else 0; def MFCPosture = if (MFC > 80) or (MFC > 20 and MFCRising) then 1 else 0; def MFCURZ = if MFC > 80 then 1 else 0; def mfcNearTerm = reference MarketForecast.nearterm; def mfcMomentum = reference MarketForecast.momentum; def BullishCluster = if MFC < 20 and mfcNearTerm < 20 and mfcMomentum < 20 then 1 else 0; def BearishCluster = if MFC > 80 and mfcNearTerm > 80 and mfcMomentum > 80 then 1 else 0; # Plot Clusters on the chart plot bullDot = if BullishCluster and ShowMfcClusters then low * .996 else Double.NaN; bullDot.SetStyle(Curve.POINTS); bullDot.SetLineWeight(5); bullDot.SetDefaultColor(Color.GREEN); bullDot.HideBubble(); plot bearDot = if BearishCluster and ShowMfcClusters then high * 1.004 else Double.NaN; bearDot.SetStyle(Curve.POINTS); bearDot.SetLineWeight(5); bearDot.SetDefaultColor(Color.RED); bearDot.HideBubble(); # Bullish Intermediate Confirmation def IntermediateConfirmation_Major = if MFCURZ and mfcMomentum < 20 and mfcMomentum > 5 and mfcNearTerm > 20 and mfcNearTerm < 50 then 1 else 0; plot IC_major = if ShowIntermediateConfirms and IntermediateConfirmation_Major then MA30 * .99 else Double.NaN; IC_major.SetPaintingStrategy(PaintingStrategy.ARROW_UP); IC_major.SetLineWeight(5); IC_major.AssignValueColor(Color.DARK_ORANGE); def IntermediateConfirmation_Minor = if MFCURZ and mfcMomentum < 20 and mfcMomentum > 5 and !(mfcNearTerm > 20 and mfcNearTerm < 50) then 1 else 0; plot IC_minor = if ShowIntermediateConfirms and IntermediateConfirmation_Minor then MA30 * .99 else Double.NaN; IC_minor.SetPaintingStrategy(PaintingStrategy.ARROW_UP); IC_minor.SetLineWeight(2); IC_minor.AssignValueColor(Color.DARK_ORANGE); AddLabel (ShowIntermediateLabel, "MFC " + Round(MFC) + " " + if MFCRising then "rising" else "falling", if MFCPosture then Color.GREEN else GlobalColor("DownArrow")); # +++++++ Show Stochastic Reversals on Chart +++++++++++ def over_bought = 75; def over_sold = 25; def KPeriod = 7; def DPeriod = 3; def priceH = high; def priceL = low; def priceC = close; def average = AverageType.SIMPLE; def SlowK = reference StochasticSlow(over_bought, over_sold, KPeriod, DPeriod, priceH, priceL, priceC, AverageType.SIMPLE).SlowK; def SlowD = reference StochasticSlow(over_bought, over_sold, KPeriod, DPeriod, priceH, priceL, priceC, AverageType.SIMPLE).SlowD; plot stoUp = if (ShowStoArrows and SlowK >= SlowD and SlowK[1] < SlowD[1]) and SlowK[1] < over_sold then low * .8 else Double.NaN; plot stoDn = if (ShowStoArrows and SlowK <= SlowD and SlowK[1] > SlowD[1]) and SlowK[1] > over_bought then high * 1.2 else Double.NaN; stoUp.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP); stoUp.SetLineWeight(3); stoUp.SetDefaultColor(Color.YELLOW); stoDn.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN); stoDn.SetLineWeight(3); stoDn.SetDefaultColor(Color.YELLOW); # Plot 10-day EMA Trend Changes def v_EMA10_up = if EMA_10day > EMA_10day[1] and EMA_10day[1] < EMA_10day[2] then 1 else 0; def v_EMA10_down = if EMA_10day < EMA_10day[1] and EMA_10day[1] > EMA_10day[2] then 1 else 0; plot EMA10_up = if v_EMA10_up and Show10DayMovingAvg then EMA_10day else double.Nan; plot EMA10_down = if v_EMA10_down and Show10DayMovingAvg then EMA_10day else double.Nan; EMA10_up.SetPaintingStrategy(PaintingStrategy.POINTS); EMA10_up.SetDefaultColor(color.GREEN); EMA10_up.SetLineWeight(3); EMA10_down.SetPaintingStrategy(PaintingStrategy.POINTS); EMA10_down.SetDefaultColor(color.RED); EMA10_down.SetLineWeight(3);
I would Like to see the above script draw a Vertical Line it already does this I would like it a little different, based off of the MF Blue Near and RED momo Lines breaking the 30 displaying a Green Vertical Line and or the Blue Near and Red momo breaking down through the 70 to produce a Red Vertical line. It would be Much better if it could display these or separate lines that could be turned on/off when Green Intermediate Line was either in a Positive trend (above 30 50 70 from a Below 20 condition) or a Negative trend (Below 70 50 30 off of a above 80 condition) alerts would also be Great.
Did you know that by clicking on a member's name, you can easily check when they were last seen on the uTS forum? It's a great way to keep track of who's been around recently, and who hasn't. Speaking of which, it looks like @westgl is no longer active. So we can't know what he was referring to.What is REDSAR?
Join useThinkScript to post your question to a community of 21,000+ developers and traders.
Thread starter | Similar threads | Forum | Replies | Date |
---|---|---|---|---|
Advanced Market Moves 2.0 Released | Indicators | 2 | ||
Advanced Volume Indicator for ThinkorSwim | Indicators | 66 | ||
Market Structure Trailing Stop [LuxAlgo] for ThinkOrSwim | Indicators | 11 | ||
Market Bias (CEREBR) Indicator for ThinkOrSwim | Indicators | 15 | ||
T | NextSignal's Market Volume Profile For ThinkOrSwim | Indicators | 16 |
Start a new thread and receive assistance from our community.
useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.
We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.
If you are new, or just looking for guidance, here are some helpful links to get you started.