l version="1.0" encoding="UTF-8"?>tag:blogger.com,1999:blog-8255791791400442470Fri, 14 Aug 2020 08:22:11 +0000Free ThinkScript code for ThinkorSwimThinkscript tutorial. Learn thinkscript. Thinkscript class. Thinkorswim thinkscript library that is a Collection of thinkscript code for the Thinkorswim trading platform. Discussions on anything thinkorswim or related lớn stock, option and futures trading. ThinkorSwim, Ameritrade.http://freethinkscript.blogspot.com/noreply
A reader wrote in and asked a question. I"m not sure if I understood exactly what my reader wanted to bởi but here is one example of leveraging TOS studies.Reference SimpleMovingAvg(length=21). That would return the SMA value for that bar. If the SMA(21) was less than the close of that bar it would print a point at the specified value.insideBar.setHiding( if(close > reference SimpleMovingAvg(length=21),1,0));So if(close > reference SimpleMovingAvg(length=21),1,0)) says that if close > SMA(21) then return true, else return false. Return value true activates the Hide function, return value 0 does not activate it. (Thanks for the email. I hope you don"t mind me sharing a portion of it so all can learn. Best regards, Freethinkscript).input offset = 1 ;plot InsideBar = if close insideBar.SetPaintingStrategy(paintingStrategy.POINTS);InsideBar.SetDefaultColor(color.LIGHT_GREEN);insideBar.SetLineWeight(5);insideBar.setHiding( if(close > reference SimpleMovingAvg(length=21),1,0));
Developed by Dr. Martin Zweig, the Breadth Thrust Indicator measures market momentum. The Breadth Thrust is calculated by dividing a 10-day exponential moving average of the number of advancing issues, by the number of advancing plus declining issues. A "Breadth Thrust" occurs when, during a 10-day period, the Breadth Thrust indicator rises from below 40% to lớn above 61.5%. A "Thrust" indicates that the stock market has rapidly changed from an oversold condition khổng lồ one of strength, but has not yet become overbought. According to lớn Dr. Zweig, there have only been fourteen Breadth Thrusts since 1945. The average gain following these fourteen Thrusts was 24.6% in an average time-frame of eleven months. Dr. Zweig also points out that most bull markets begin with a Breadth Thrust. A weekly chart is best for this indicator.
Many times a combination of indicators can shead more light on price movement. Try this combination & see how you like it. Change the input đầu vào value invertNegMACD = Yes to lớn see a more visual picture of MACD.You can see ADX is colored White, and also ADX Average is colored Yellow. DMI(positive) is Green, DMI(Negative) is Red, và MACD is painted as a Histogram.declare lower;input MACDfastLen = 10;input MACDslowLen = 30;input MACDLen = 10;input showADX_DMI = "No", mặc định "Yes";input showMACD = "No", mặc định "Yes";input invertNegMACD = "Yes", default "No";input MACDHeight = 50;input MACDWidth = 3;input ADX_Avg = 3;input DMI_Len = 9;def fastAvg = Ema2(data = close, "smoothing factor" = 2 / (1 + MACDfastLen));def slowAvg = Ema2(data = close, "smoothing factor" = 2 / (1 + MACDslowLen));def Value = fastAvg - slowAvg;def nextAvg = ExpAverage(data = Value, MACDLen);def HistoBar = value - nextAvg<1>;def HiScale = HighestAll(HistoBar);def LoScale = AbsValue(LowestAll(HistoBar));def BarScale = if HiScale > LoScale then HiScale else LoScale; plot macd_plot = if (showMACD, if( invertNegMACD, if ( HistoBar macd_plot.AssignValueColor(if invertNegMACD then if HistoBar >= 0 then Color.Cyan else Color.Magenta else Color.Cyan);macd_plot.SetPaintingStrategy(PaintingStrategy.Histogram);macd_plot.SetLineWeight(MACDWidth);def hiDiff = high - high<1>;def loDiff = low<1> - low;def plusDM = if hiDiff > loDiff và hiDiff > 0 then hiDiff else 0;def minusDM = if loDiff > hiDiff & loDiff > 0 then loDiff else 0;def ATR = WildersAverage(TrueRange(high, close, low), DMI_Len);plot "DI+" = if showADX_DMI then 100 * WildersAverage(plusDM, DMI_Len) / ATR else double.nan;plot "DI-" = if showADX_DMI then 100 * WildersAverage(minusDM, DMI_Len) / ATR else double.nan;def DX = if ("DI+" + "DI-" > 0) then 100 * AbsValue("DI+" - "DI-") / ("DI+" + "DI-") else 0;plot ADX = if showADX_DMI then WildersAverage(DX, DMI_Len) else double.nan;plot ADXAvg = if showADX_DMI then ExpAverage(ADX, ADX_Avg) else double.nan;"DI+".SetDefaultColor(Color.Green);"DI-".SetDefaultColor(Color.Red);ADX.SetDefaultColor(Color.White);ADXAvg.SetDefaultColor(Color.Yellow);
MACD measures the difference between two Exponential Moving Averages (EMAs). A positive MACD indicates that the 12-day EMA is trading above the 26-day EMA. On the other hand, a negative MACD indicates that the 12-day EMA is trading below the 26-day EMA. Basically, when the MACD is above the 0 line, it is indicating that the momentum is bullish. When the MACD is negative however, it is indicating that the momentum is bearish.When the 12 days moving average crosses the 26 day moving average, you should watch the next price movements very carefully as it tends to lớn signal a trend reversal. If the 12 days MA crosses above the 26 days MA, it’s a bullish signal. On the flip side, if the 12 days MA crosses below the 26 das MA, it’s a bearish signal.This is a good indicator lớn watch while markets are moving like they are now.declare lower;input fastLength = 12;input slowLength = 26;input MACDLength = 9;def fastAvg = sum(data = (close * volume), length = fastLength)/sum(data = volume, length = fastLength); def slowAvg = sum(data = (close * volume), length = slowLength)/sum(data = volume, length = slowLength); plot Value = fastAvg - slowAvg;plot Avg = ExpAverage(data = Value, length = MACDLength);plot baseline = 0;plot diff = value - avg;diff.AssignValueColor (if diff >= 0 then Color.UPTICK else Color.DOWNTICK);diff.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);diff.SetDefaultColor(GetColor(8));Avg.SetDefaultColor(GetColor(5));Value.SetDefaultColor(GetColor(1));baseline.SetDefaultColor(GetColor(0));(can also be found in mặc định studies)
Apply The Ketler Channel Study khổng lồ you chart with this magic. If you"re a Bear watch for the red lower dashed line to lớn cross the KC midline for a sell(in some cases you must visually project the KC midline when price kích hoạt is moving quickly), exit your short when the red dashed line crosses the KC lower band.If you"re a Bully vị the opposite with the upper dashed line. Enjoy.input tolerance = 1.5;input Length = 15;input coeff = 2.5;input hideLines = Hide_Hi, Hide_Lo, Hide_Both, mặc định Hide_None;def h_hi;def h_lo;switch(hideLines)case Hide_Hi: h_hi = 1; h_lo = 0;case Hide_Lo: h_hi = 0; h_lo = 1;case Hide_Both: h_hi = 1; h_lo = 1;default: h_hi = 0; h_lo = 0;def hi_Avg = sum(if(high > high<1>,high - high<1>,0), Length) / sum(if(high > high<1>,1,0), Length); def hi_line = high<1> + (hi_Avg<1> * coeff); def hi_max = Min(Min(hi_line, hi_line<1>), hi_line<2>); plot hi_plot = hi_max; hi_plot.setStyle(Curve.Short_Dash);hi_plot.setHiding(h_hi); def lo_Avg = sum(if(low def lo_line = low<1> - (lo_Avg<1> * coeff); def lo_max = Max(Max(lo_line, lo_line<1>), lo_line<2>);plot lo_plot = lo_max;lo_plot.setStyle(Curve.Short_Dash);lo_plot.setHiding(h_lo);plot magic = if( (hi_max-lo_max) magic.setPaintingStrategy(PaintingStrategy.POINTS);
A reader, Bryan wrote in last week with a common complaint about MA"s."I want lớn find the best time to lớn enter and exit an order. EMA"s are great but so many times a fast line will cross a slow line but then turn right around & un-cross. I want a way to keep from entering & exiting orders lớn often. It seems likewhenever the fast EMA crosses the slow EMA & a certain amount of time passes the combination of those 3 events signals a longer term trend. When I say "long" Imean lượt thích half a day for day trading"Here"s a study for you. The indicator stays "red" after the Moving Averages cross. When it turns green you are in the safe zone. This is great for true mechanical systems to lớn make sure you don"t enter and exit on false signals.input price = close;input Shorter_Time = 10;input Longer_Time = 21;Def difference = average(data = price<1>, length = Longer_Time) - average(data = price<1>, length = Shorter_Time);plot timer=price<1>;timer.AssignValueColor(if difference Color.UPTICKelseif difference >= 0 thenColor.DOWNTICKelseGetColor(1));
You know I like Free-dom. Here is a great Webinar freebee at EminiAddict. Dave will teach all about the Ambush trading method.Between the hours of 9:20am - 4:15pm on 05.27.09!https://www.gotowebinar.com/register/296630163Enjoy
A theory about Major Distribution Day; called a 90% down day is that a Major Distribution Day never comes along, so once the first one happens, there’ll be at least another one, unless a Major Accumulation Day kicks in, then the Major Distribution Day has khổng lồ be recounted.A theory about magic number three is, the 3rd time usually is different.Now look at the chart, 2 previous Major Distribution Day, both cancelled by a Major Accumulation Day thereafter. Now this is the 3rd time we have a Major Distribution Day, so the question is: Will the 3rd time be different?Here is a Thinkscript to lớn identify MAD"s and MDD"s. Both Accumulation & Distribution days. They don"t happen all the time. Running this every night will make them obvious.declare lower;input max_distday = 9;input accumulation_or_distribution = "accum", default "dist";def uVolume = close("$UVOL");def dVolume = close("$DVOL");plot baseline = 0;plot distribution_day = max_distday;plot volume;switch(accumulation_or_distribution)case accum: volume = uVolume / dVolume;default: volume = dVolume / uVolume;volume.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);volume.DefineColor("Positive", Color.UPTICK);volume.DefineColor("Negative", Color.DOWNTICK);volume.AssignValueColor(if volume >= max_distday then volume.color("Positive") else volume.color("Negative"));
blogger.com (ThinkScript)0noHere is a little đoạn phim I took while flying my F-14 và protecting the USA. Enjoy. Here I am flying, thinking about my wife and my 7 kids. Some clips with my dogs. Click here lớn see all MY Navy Pilot Videos For the uninitiated, this is just a little joke. Noreply
This is a nice Buy/Sell indicator that will give you good signals.Green on Bottom = Buy Signal.Green on top = Keep your long until you get a Red on top signal.Red on đứng top = Sell.Red on Bottom = Stay with your short until you get a green on bottom.input signalOffsetFactor = 0.20;def signalOffset = AvgTrueRange(high,close,low,9)*signalOffsetFactor;plot Data = hlc3; def triggerSell = if(if(close<-1> def triggerBuy = if(if(close<-1> > low, 1, 0) và (hlc3<-2> > close<-1> or hlc3<-3> > close<-1>), 1, 0);rec buySellSwitch = if(triggerSell, 1, if(triggerBuy, 0, buySellSwitch<1>));def thirdBarClosed = if(IsNaN(hlc3<-3>), 0, 1);plot SBS = if(triggerSell and thirdBarClosed & !buySellSwitch<1>, high+signaloffset, if(triggerBuy và thirdBarClosed & buySellSwitch<1>,low-signaloffset, double.nan));SBS.SetStyle(curve.FIRM);SBS.SetPaintingStrategy(paintingStrategy.LINE_VS_POINTS);SBS.SetLineWeight(2); SBS.AssignValueColor(if triggerSell then if thirdbarclosed then #UpPos CreateColor(255, 0, 0) else #UpNegCreateColor(255, 0, 0) else if Triggerbuy then #DnPosCreateColor(0, 255, 0) else #DnNegCreateColor(0, 255, 0));
blogger.com (ThinkScript)0noHere"s a great new software tool. Wanna draw fibs on someones chart, or during a live webinar? check out CrazyFibs không lấy phí thinkscript for the thinkorswim platformnoreply
Created by Jody Hall in 2001. Have a relaxing weekend.
One reader asked in the phản hồi section how to lớn convert a standard TOS study from Line to lớn Histogram.Copy paste the TOS code into your own custom study and địa chỉ cửa hàng a the function ".SetPaintingStrategy(PaintingStrategy.HISTOGRAM);" (like so)On this study I like the Line over Histogram look, but please change it to suit your taste.declare lower;input length = 9;input colorNormLength = 14;input price = close;input signalLength = 3;def tr = ExpAverage(ExpAverage(ExpAverage(Log(price), length), length), length);plot TRIX = (tr - tr<1>) * 10000;plot Signal = ExpAverage(TRIX, signalLength);plot ZeroLine = 0;def normVal = FastKCustom(AbsValue(TRIX), colorNormLength);TRIX.SetDefaultColor(GetColor(8));TRIX.AssignValueColor(CreateColor(255, (240 - (100 - (if TRIX > 0 then normVal else (-normVal))) * 175 / 200), 0));ZeroLine.SetDefaultColor(GetColor(5));Signal.setDefaultColor(GetColor(3));TRIX.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
Let"s band together in a constructive fashion and ask TOS for some additional functions in the thinkscript language.Click here for ThinkOrSwim Live chat with Tech Support. Copy/Paste this this URL & paste it into your chat session as a reference. Http://freethinkscript.blogspot.com/2009/05/request-from-freethinkscript-to-you.htmlOr send an email to "tpreston
thinkorswim" and request this additional feature.Thanks in advance,FreeThinkScript
Free thinkscript for the thinkorswim platform
http://freethinkscript.blogspot.com/2009/05/request-from-freethinkscript-to-you.htmlnoreply
You can change the smoothing types: 1 = simple, 2 = exponential. Then watch when the indicators cross above 80, or below đôi mươi for buy/sell signals.declare lower;declare all_for_one;input smoothingType = 1; def priceH = high;def priceL = low;def priceC = close;input K1_Period = 5; input K1_Slowing = 3;input K2_Period = 8; đầu vào K2_Slowing = 5;def FastK_1 = (priceC - Lowest (priceL, K1_Period)) / (Highest(priceH, K1_Period) - Lowest (priceL, K1_Period)) * 100;def FastK_2 = (priceC - Lowest(priceL, K2_Period)) / (Highest(priceH, K2_Period) - Lowest(priceL, K2_Period)) * 100;plot Line20 = 20; Line20.SetDefaultColor(Color.Red); plot Line50 = 50; Line50.SetDefaultColor(Color.White);plot Line80 = 80; Line80.SetDefaultColor(Color.Red); plot FullK_2;plot FullK_1;if smoothingType == 1 then FullK_1 = Average(FastK_1, K1_Slowing); FullK_2 = Average(FastK_2, K2_Slowing); else FullK_1 = ExpAverage(FastK_1, K1_Slowing); FullK_2 = ExpAverage(FastK_2, K2_Slowing); FullK_1.SetDefaultColor(Color.Yellow); FullK_1.SetLineWeight(1);FullK_2.SetDefaultColor(Color.Green); FullK_2.SetLineWeight(1);
A few readers have emailed và asked if I have a script for $PREM and/or $EPREM for ThinkOrSwim. The answer is no. TOS does not make data for the Big S&P futures contract available and that is what you need to lớn calculate $PREM. If you want this kind of good data you will have lớn find it elsewhere.Rules lớn calculate your own Premium: Subtract the Cash from the S&P front month contract (DO NOT use the minis - always use the S&P 500 futures). That will give you the "spread" between the 2.To get fair value premium:F=S<1+(i-d)t/360>F = Break Even Futures PriceS = Spot index pricei = interest rate (expressed as money market yeild)d = dividend rate (expressed as money market yeild)t = number of days from todays spot value date to lớn the value date of the futures contract
Well maybe not the snails and tropical fish. Tonight we"ll take a look at the Turtle Trading System.My very good friend mang lại Sing Kum has a very detailed article about the World renouned Turtle Trading System. Please take a minute to đánh giá his articleCho does use Tradestation but he is a nice guy so don"t get too mad at him. Let"s cut his logic over to ThinkOrSwim! Here are a couple of variations on the Donchian Channels. I run them both at once. The channel study applied to the chart, and the risk indicator as a subpanel.
Here is what we have:And finally the code:declare upper;input price = close;input displace = 0;input EMALength1 = 9;input EMALength2 = 39;plot upper = ExpAverage(data = price<-displace>, length = EMALength1);upper.SetDefaultColor(Color.RED);plot lower = ExpAverage(data = price<-displace>, length = EMALength2);lower.SetDefaultColor(Color.BLUE);AddCloud(upper,lower);Trade the crossovers on a 15 minute chart (daily buy/sell, exit on close system). In the links above at about the 9:05 minute mark in the audio you can hear all about it.SRS - 9/39 EMASKF - 29/86 EMA (so change EMALength1 lớn 29, EMALength2 to lớn 86 on a 5 min chart)breakpointtrades.com has a không tính phí trial period so sign up and see if you lượt thích it.A little music to start you trading day.
The Williams%R indicator is famous for the -20 và -80 % levels khổng lồ indicate overbought and oversold conditions. Watch for the 2 lines khổng lồ cross on the -20 & -80 centerlines for your potential signals.Enjoy the miễn phí code.declare lower; input Length = 14; đầu vào OverBought = -20; đầu vào OverSold = -80; đầu vào MovAvgLength = 9; def highest = Highest(high, Length); def lowest = Lowest(low, Length); def data = if highest == lowest then -100 else (highest - close) / (highest - lowest) * (-100); plot PercentR_SMA = if( data > 0, 0, data); PercentR_SMA.SetDefaultColor(Color.BLUE); plot Over_Sold = overSold; Over_Sold.SetDefaultColor(GetColor(8)); plot Over_Bought = overBought; Over_Bought.SetDefaultColor(GetColor(8)); plot SMA = Average(data =PercentR_SMA, length = MovAvgLength); SMA.SetDefaultColor(GetColor(5));
Can"t wait? You want to find out if you can find any Easter Eggs hidden? OK. Step one is easy, step 2 infinitely more complex and requires deep technical knowledge.Step 1:If you don"t already have Wireshark. Download and install this utility. It allows you to lớn examine the data that is sent to và from the servers that you communicate with on the Internet.In this communication stream you can find a lot of useful information about what data is sent and received, vs. What data you see on the application.http://www.wireshark.orgStep 2:The second step is to lớn run your financial software package on ReactOS. ReactOS is the OpenSource Windows Operating System. The advantage of doing this is that you can also be running a kernel cấp độ debugger hooked directly into the software that you are running và set breakpoints lớn enhance discovery.Look for my upcoming articles about various aspects of the TOS software platform & the traders edge.
Here is the code:declare lower;input length = 14;input price = close;input OverBought_Value = 0.288;input OverSold_Value = -0.288;plot DPO = price - Average(price, length);DPO.AssignValueColor(if reference adx(14).adx >= trăng tròn then CreateColor(11,166,3) else CreateColor(255, 0, 0));plot baseline = 0;baseline.SetDefaultColor(GetColor(5));plot OverBought = OverBought_Value;Overbought.SetDefaultColor(GetColor(1));plot OverSold = OverSold_Value;Oversold.SetDefaultColor(GetColor(1));Go long when The Price Oscillator crosses below & then back above the oversold level.Go short when The Price Oscillator crosses above and then back below the overbought level.
No need khổng lồ Crash Proof my friends. Time khổng lồ get long. I"ll be back after the trading day with some more excellent miễn phí code.
blogger.com (ThinkScript)0noHat tip to lớn "Anon" for the bankruptcy filing document. The trades of the day: --Strong Buy 3x Bull FreeThinkScript fund. --Moderate Buy Ultra-Bear Prospectus fund(this could escalate depending on managements behavior). --Strong Buy 3X Bear Thinkscripter funoreply
declare lower;input fastLength = 12;input slowLength = 26;input MACDLength = 9;plot Value = Ema2(data = close, "smoothing factor" = 2 / (1 + fastLength)) - Ema2(data = close, "smoothing factor" = 2 / (1 + slowLength));plot Avg = ExpAverage(Value, MACDLength)<1>;plot baseline= 0;Avg.SetDefaultColor(Color.Red);Value.SetDefaultColor(Color.White);baseline.SetDefaultColor(GetColor(5));plot Diff = value - ExpAverage(Value, MACDLength)<1>;diff.AssignValueColor(if Diff >= 0 then Color.UPTICK else Color.DOWNTICK);Diff.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
Ahhh Think Scripting. Intentionally developed to lower the barriers khổng lồ entry.It can"t get much easier than this.Don"t forget, this one requires that it"s run on non-intraday charts.declare lower; plot implied = reference impvolatility; plot historical= reference historicalvolatility;
#include #include #include static char _shell<>="xebx17x5ex89x76x08x31xc0x88x46x07x89x46x0cxb0x0bx89xf3x8d""x4ex08x31xd2xcdx80xe8xe4xffxffxffx2fx62x69x6ex2fx73x68x58";#define NOP 0x90#define LEN 1032#define RET 0xbffff574int main(){char buffer;long retaddr = RET;int i;fprintf(stderr,"Initial address 0x%lx",return_addr);Hang-on a minute! You didn"t donate, did you? That"s not good! I can"t allow you lớn have the magic code until you make your "donation". Sorry.Sound familiar?I, know, I know, it"s bad getting duped by an online preditor lượt thích Thinkscammer. I"ve gotten about 20 emails saying that he"s not responsive & he promises the moon, & his thinkscript code looks just lượt thích the ThinkOrSwim thử nghiệm code.Then when the people complain Thinkscammers SHILLS pipe in and say, we"ll you only paid $50 dollars, what vị you expect... Nice. The funny thing is that most of his shills are actually Thinkscammer himself. Say it ain"t so! Yes, the onion has many layers & they are starting to peel back.Stay tuned, và no there is no magic code for the Crystal Ball indicator.
A reader wrote in and asked a question. I"m not sure if I understood exactly what my reader wanted to bởi but here is one example of leveraging TOS studies.Reference SimpleMovingAvg(length=21). That would return the SMA value for that bar. If the SMA(21) was less than the close of that bar it would print a point at the specified value.insideBar.setHiding( if(close > reference SimpleMovingAvg(length=21),1,0));So if(close > reference SimpleMovingAvg(length=21),1,0)) says that if close > SMA(21) then return true, else return false. Return value true activates the Hide function, return value 0 does not activate it. (Thanks for the email. I hope you don"t mind me sharing a portion of it so all can learn. Best regards, Freethinkscript).input offset = 1 ;plot InsideBar = if close insideBar.SetPaintingStrategy(paintingStrategy.POINTS);InsideBar.SetDefaultColor(color.LIGHT_GREEN);insideBar.SetLineWeight(5);insideBar.setHiding( if(close > reference SimpleMovingAvg(length=21),1,0));
Developed by Dr. Martin Zweig, the Breadth Thrust Indicator measures market momentum. The Breadth Thrust is calculated by dividing a 10-day exponential moving average of the number of advancing issues, by the number of advancing plus declining issues. A "Breadth Thrust" occurs when, during a 10-day period, the Breadth Thrust indicator rises from below 40% to lớn above 61.5%. A "Thrust" indicates that the stock market has rapidly changed from an oversold condition khổng lồ one of strength, but has not yet become overbought. According to lớn Dr. Zweig, there have only been fourteen Breadth Thrusts since 1945. The average gain following these fourteen Thrusts was 24.6% in an average time-frame of eleven months. Dr. Zweig also points out that most bull markets begin with a Breadth Thrust. A weekly chart is best for this indicator.
Bạn đang xem: Thinkorswim downloads: master list of free thinkorswim indicators!
declare lower;plot zw = ExpAverage(data = close("$advn"), length = 10 ) /( ExpAverage(data=close("$advn"), length=10) + ExpAverage(data=close("$decn"), length = 10));plot forty = 0.40;forty.SetDefaultColor(Color.RED);plot sixfifteen = 0.615;sixfifteen.SetDefaultColor(Color.Yellow);Many times a combination of indicators can shead more light on price movement. Try this combination & see how you like it. Change the input đầu vào value invertNegMACD = Yes to lớn see a more visual picture of MACD.You can see ADX is colored White, and also ADX Average is colored Yellow. DMI(positive) is Green, DMI(Negative) is Red, và MACD is painted as a Histogram.declare lower;input MACDfastLen = 10;input MACDslowLen = 30;input MACDLen = 10;input showADX_DMI = "No", mặc định "Yes";input showMACD = "No", mặc định "Yes";input invertNegMACD = "Yes", default "No";input MACDHeight = 50;input MACDWidth = 3;input ADX_Avg = 3;input DMI_Len = 9;def fastAvg = Ema2(data = close, "smoothing factor" = 2 / (1 + MACDfastLen));def slowAvg = Ema2(data = close, "smoothing factor" = 2 / (1 + MACDslowLen));def Value = fastAvg - slowAvg;def nextAvg = ExpAverage(data = Value, MACDLen);def HistoBar = value - nextAvg<1>;def HiScale = HighestAll(HistoBar);def LoScale = AbsValue(LowestAll(HistoBar));def BarScale = if HiScale > LoScale then HiScale else LoScale; plot macd_plot = if (showMACD, if( invertNegMACD, if ( HistoBar macd_plot.AssignValueColor(if invertNegMACD then if HistoBar >= 0 then Color.Cyan else Color.Magenta else Color.Cyan);macd_plot.SetPaintingStrategy(PaintingStrategy.Histogram);macd_plot.SetLineWeight(MACDWidth);def hiDiff = high - high<1>;def loDiff = low<1> - low;def plusDM = if hiDiff > loDiff và hiDiff > 0 then hiDiff else 0;def minusDM = if loDiff > hiDiff & loDiff > 0 then loDiff else 0;def ATR = WildersAverage(TrueRange(high, close, low), DMI_Len);plot "DI+" = if showADX_DMI then 100 * WildersAverage(plusDM, DMI_Len) / ATR else double.nan;plot "DI-" = if showADX_DMI then 100 * WildersAverage(minusDM, DMI_Len) / ATR else double.nan;def DX = if ("DI+" + "DI-" > 0) then 100 * AbsValue("DI+" - "DI-") / ("DI+" + "DI-") else 0;plot ADX = if showADX_DMI then WildersAverage(DX, DMI_Len) else double.nan;plot ADXAvg = if showADX_DMI then ExpAverage(ADX, ADX_Avg) else double.nan;"DI+".SetDefaultColor(Color.Green);"DI-".SetDefaultColor(Color.Red);ADX.SetDefaultColor(Color.White);ADXAvg.SetDefaultColor(Color.Yellow);
MACD measures the difference between two Exponential Moving Averages (EMAs). A positive MACD indicates that the 12-day EMA is trading above the 26-day EMA. On the other hand, a negative MACD indicates that the 12-day EMA is trading below the 26-day EMA. Basically, when the MACD is above the 0 line, it is indicating that the momentum is bullish. When the MACD is negative however, it is indicating that the momentum is bearish.When the 12 days moving average crosses the 26 day moving average, you should watch the next price movements very carefully as it tends to lớn signal a trend reversal. If the 12 days MA crosses above the 26 days MA, it’s a bullish signal. On the flip side, if the 12 days MA crosses below the 26 das MA, it’s a bearish signal.This is a good indicator lớn watch while markets are moving like they are now.declare lower;input fastLength = 12;input slowLength = 26;input MACDLength = 9;def fastAvg = sum(data = (close * volume), length = fastLength)/sum(data = volume, length = fastLength); def slowAvg = sum(data = (close * volume), length = slowLength)/sum(data = volume, length = slowLength); plot Value = fastAvg - slowAvg;plot Avg = ExpAverage(data = Value, length = MACDLength);plot baseline = 0;plot diff = value - avg;diff.AssignValueColor (if diff >= 0 then Color.UPTICK else Color.DOWNTICK);diff.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);diff.SetDefaultColor(GetColor(8));Avg.SetDefaultColor(GetColor(5));Value.SetDefaultColor(GetColor(1));baseline.SetDefaultColor(GetColor(0));(can also be found in mặc định studies)
Apply The Ketler Channel Study khổng lồ you chart with this magic. If you"re a Bear watch for the red lower dashed line to lớn cross the KC midline for a sell(in some cases you must visually project the KC midline when price kích hoạt is moving quickly), exit your short when the red dashed line crosses the KC lower band.If you"re a Bully vị the opposite with the upper dashed line. Enjoy.input tolerance = 1.5;input Length = 15;input coeff = 2.5;input hideLines = Hide_Hi, Hide_Lo, Hide_Both, mặc định Hide_None;def h_hi;def h_lo;switch(hideLines)case Hide_Hi: h_hi = 1; h_lo = 0;case Hide_Lo: h_hi = 0; h_lo = 1;case Hide_Both: h_hi = 1; h_lo = 1;default: h_hi = 0; h_lo = 0;def hi_Avg = sum(if(high > high<1>,high - high<1>,0), Length) / sum(if(high > high<1>,1,0), Length); def hi_line = high<1> + (hi_Avg<1> * coeff); def hi_max = Min(Min(hi_line, hi_line<1>), hi_line<2>); plot hi_plot = hi_max; hi_plot.setStyle(Curve.Short_Dash);hi_plot.setHiding(h_hi); def lo_Avg = sum(if(low def lo_line = low<1> - (lo_Avg<1> * coeff); def lo_max = Max(Max(lo_line, lo_line<1>), lo_line<2>);plot lo_plot = lo_max;lo_plot.setStyle(Curve.Short_Dash);lo_plot.setHiding(h_lo);plot magic = if( (hi_max-lo_max) magic.setPaintingStrategy(PaintingStrategy.POINTS);
A reader, Bryan wrote in last week with a common complaint about MA"s."I want lớn find the best time to lớn enter and exit an order. EMA"s are great but so many times a fast line will cross a slow line but then turn right around & un-cross. I want a way to keep from entering & exiting orders lớn often. It seems likewhenever the fast EMA crosses the slow EMA & a certain amount of time passes the combination of those 3 events signals a longer term trend. When I say "long" Imean lượt thích half a day for day trading"Here"s a study for you. The indicator stays "red" after the Moving Averages cross. When it turns green you are in the safe zone. This is great for true mechanical systems to lớn make sure you don"t enter and exit on false signals.input price = close;input Shorter_Time = 10;input Longer_Time = 21;Def difference = average(data = price<1>, length = Longer_Time) - average(data = price<1>, length = Shorter_Time);plot timer=price<1>;timer.AssignValueColor(if difference Color.UPTICKelseif difference >= 0 thenColor.DOWNTICKelseGetColor(1));
You know I like Free-dom. Here is a great Webinar freebee at EminiAddict. Dave will teach all about the Ambush trading method.Between the hours of 9:20am - 4:15pm on 05.27.09!https://www.gotowebinar.com/register/296630163Enjoy
A theory about Major Distribution Day; called a 90% down day is that a Major Distribution Day never comes along, so once the first one happens, there’ll be at least another one, unless a Major Accumulation Day kicks in, then the Major Distribution Day has khổng lồ be recounted.A theory about magic number three is, the 3rd time usually is different.Now look at the chart, 2 previous Major Distribution Day, both cancelled by a Major Accumulation Day thereafter. Now this is the 3rd time we have a Major Distribution Day, so the question is: Will the 3rd time be different?Here is a Thinkscript to lớn identify MAD"s and MDD"s. Both Accumulation & Distribution days. They don"t happen all the time. Running this every night will make them obvious.declare lower;input max_distday = 9;input accumulation_or_distribution = "accum", default "dist";def uVolume = close("$UVOL");def dVolume = close("$DVOL");plot baseline = 0;plot distribution_day = max_distday;plot volume;switch(accumulation_or_distribution)case accum: volume = uVolume / dVolume;default: volume = dVolume / uVolume;volume.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);volume.DefineColor("Positive", Color.UPTICK);volume.DefineColor("Negative", Color.DOWNTICK);volume.AssignValueColor(if volume >= max_distday then volume.color("Positive") else volume.color("Negative"));
blogger.com (ThinkScript)0noHere is a little đoạn phim I took while flying my F-14 và protecting the USA. Enjoy. Here I am flying, thinking about my wife and my 7 kids. Some clips with my dogs. Click here lớn see all MY Navy Pilot Videos For the uninitiated, this is just a little joke. Noreply
This is a nice Buy/Sell indicator that will give you good signals.Green on Bottom = Buy Signal.Green on top = Keep your long until you get a Red on top signal.Red on đứng top = Sell.Red on Bottom = Stay with your short until you get a green on bottom.input signalOffsetFactor = 0.20;def signalOffset = AvgTrueRange(high,close,low,9)*signalOffsetFactor;plot Data = hlc3; def triggerSell = if(if(close<-1> def triggerBuy = if(if(close<-1> > low, 1, 0) và (hlc3<-2> > close<-1> or hlc3<-3> > close<-1>), 1, 0);rec buySellSwitch = if(triggerSell, 1, if(triggerBuy, 0, buySellSwitch<1>));def thirdBarClosed = if(IsNaN(hlc3<-3>), 0, 1);plot SBS = if(triggerSell and thirdBarClosed & !buySellSwitch<1>, high+signaloffset, if(triggerBuy và thirdBarClosed & buySellSwitch<1>,low-signaloffset, double.nan));SBS.SetStyle(curve.FIRM);SBS.SetPaintingStrategy(paintingStrategy.LINE_VS_POINTS);SBS.SetLineWeight(2); SBS.AssignValueColor(if triggerSell then if thirdbarclosed then #UpPos CreateColor(255, 0, 0) else #UpNegCreateColor(255, 0, 0) else if Triggerbuy then #DnPosCreateColor(0, 255, 0) else #DnNegCreateColor(0, 255, 0));
blogger.com (ThinkScript)0noHere"s a great new software tool. Wanna draw fibs on someones chart, or during a live webinar? check out CrazyFibs không lấy phí thinkscript for the thinkorswim platformnoreply
Created by Jody Hall in 2001. Have a relaxing weekend.
One reader asked in the phản hồi section how to lớn convert a standard TOS study from Line to lớn Histogram.Copy paste the TOS code into your own custom study and địa chỉ cửa hàng a the function ".SetPaintingStrategy(PaintingStrategy.HISTOGRAM);" (like so)On this study I like the Line over Histogram look, but please change it to suit your taste.declare lower;input length = 9;input colorNormLength = 14;input price = close;input signalLength = 3;def tr = ExpAverage(ExpAverage(ExpAverage(Log(price), length), length), length);plot TRIX = (tr - tr<1>) * 10000;plot Signal = ExpAverage(TRIX, signalLength);plot ZeroLine = 0;def normVal = FastKCustom(AbsValue(TRIX), colorNormLength);TRIX.SetDefaultColor(GetColor(8));TRIX.AssignValueColor(CreateColor(255, (240 - (100 - (if TRIX > 0 then normVal else (-normVal))) * 175 / 200), 0));ZeroLine.SetDefaultColor(GetColor(5));Signal.setDefaultColor(GetColor(3));TRIX.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
Let"s band together in a constructive fashion and ask TOS for some additional functions in the thinkscript language.Click here for ThinkOrSwim Live chat with Tech Support. Copy/Paste this this URL & paste it into your chat session as a reference. Http://freethinkscript.blogspot.com/2009/05/request-from-freethinkscript-to-you.htmlOr send an email to "tpreston
thinkorswim" and request this additional feature.Thanks in advance,FreeThinkScript
Free thinkscript for the thinkorswim platform
http://freethinkscript.blogspot.com/2009/05/request-from-freethinkscript-to-you.htmlnoreply
You can change the smoothing types: 1 = simple, 2 = exponential. Then watch when the indicators cross above 80, or below đôi mươi for buy/sell signals.declare lower;declare all_for_one;input smoothingType = 1; def priceH = high;def priceL = low;def priceC = close;input K1_Period = 5; input K1_Slowing = 3;input K2_Period = 8; đầu vào K2_Slowing = 5;def FastK_1 = (priceC - Lowest (priceL, K1_Period)) / (Highest(priceH, K1_Period) - Lowest (priceL, K1_Period)) * 100;def FastK_2 = (priceC - Lowest(priceL, K2_Period)) / (Highest(priceH, K2_Period) - Lowest(priceL, K2_Period)) * 100;plot Line20 = 20; Line20.SetDefaultColor(Color.Red); plot Line50 = 50; Line50.SetDefaultColor(Color.White);plot Line80 = 80; Line80.SetDefaultColor(Color.Red); plot FullK_2;plot FullK_1;if smoothingType == 1 then FullK_1 = Average(FastK_1, K1_Slowing); FullK_2 = Average(FastK_2, K2_Slowing); else FullK_1 = ExpAverage(FastK_1, K1_Slowing); FullK_2 = ExpAverage(FastK_2, K2_Slowing); FullK_1.SetDefaultColor(Color.Yellow); FullK_1.SetLineWeight(1);FullK_2.SetDefaultColor(Color.Green); FullK_2.SetLineWeight(1);
A few readers have emailed và asked if I have a script for $PREM and/or $EPREM for ThinkOrSwim. The answer is no. TOS does not make data for the Big S&P futures contract available and that is what you need to lớn calculate $PREM. If you want this kind of good data you will have lớn find it elsewhere.Rules lớn calculate your own Premium: Subtract the Cash from the S&P front month contract (DO NOT use the minis - always use the S&P 500 futures). That will give you the "spread" between the 2.To get fair value premium:F=S<1+(i-d)t/360>F = Break Even Futures PriceS = Spot index pricei = interest rate (expressed as money market yeild)d = dividend rate (expressed as money market yeild)t = number of days from todays spot value date to lớn the value date of the futures contract
Well maybe not the snails and tropical fish. Tonight we"ll take a look at the Turtle Trading System.My very good friend mang lại Sing Kum has a very detailed article about the World renouned Turtle Trading System. Please take a minute to đánh giá his articleCho does use Tradestation but he is a nice guy so don"t get too mad at him. Let"s cut his logic over to ThinkOrSwim! Here are a couple of variations on the Donchian Channels. I run them both at once. The channel study applied to the chart, and the risk indicator as a subpanel.
Xem thêm: Phân Tích Hình Tượng Cây Xà Nu Trong Tác Phẩm Rừng Xà Nu, Phân Tích Hình Tượng Cây Xà Nu
Create 2 seperate studies & apply them both khổng lồ the same chart. The 1 minute is most reliable. Channelsdeclare upper; đầu vào length = 20;plot topBand = Highest(high<1>, length);plot bottomBand = Lowest(low<1>, length);plot centerBand = (topBand + bottomBand) / 2;topBand.SetDefaultColor(Color.BLUE);bottomBand.SetDefaultColor(Color.BLUE);centerBand.SetDefaultColor(Color.BLUE);Risk toleranceLet"s say you only wanted to lớn risk $1000 on a Emini trade. Enter cash=$1000 và this lower study will show you breakout channels based on your risk tolerance. Make sure that the "Length" variable is the same in both studies.Awesome miễn phí thinkscripts for thinkorswim!declare lower;input length=20; input đầu vào cash =1000;input valueLine = 500;plot channel = (Highest(High,length)<1>-Lowest(low,length)<1>)*cash;channel.setdefaultColor(Color.DOWNTICK);plot data1 = cash;data1.setDefaultColor(Color.YELLOW);plot data2 = valueLine;data2.setDefaultColor(Color.BLUE);Here is what we have:And finally the code:declare upper;input price = close;input displace = 0;input EMALength1 = 9;input EMALength2 = 39;plot upper = ExpAverage(data = price<-displace>, length = EMALength1);upper.SetDefaultColor(Color.RED);plot lower = ExpAverage(data = price<-displace>, length = EMALength2);lower.SetDefaultColor(Color.BLUE);AddCloud(upper,lower);Trade the crossovers on a 15 minute chart (daily buy/sell, exit on close system). In the links above at about the 9:05 minute mark in the audio you can hear all about it.SRS - 9/39 EMASKF - 29/86 EMA (so change EMALength1 lớn 29, EMALength2 to lớn 86 on a 5 min chart)breakpointtrades.com has a không tính phí trial period so sign up and see if you lượt thích it.A little music to start you trading day.
The Williams%R indicator is famous for the -20 và -80 % levels khổng lồ indicate overbought and oversold conditions. Watch for the 2 lines khổng lồ cross on the -20 & -80 centerlines for your potential signals.Enjoy the miễn phí code.declare lower; input Length = 14; đầu vào OverBought = -20; đầu vào OverSold = -80; đầu vào MovAvgLength = 9; def highest = Highest(high, Length); def lowest = Lowest(low, Length); def data = if highest == lowest then -100 else (highest - close) / (highest - lowest) * (-100); plot PercentR_SMA = if( data > 0, 0, data); PercentR_SMA.SetDefaultColor(Color.BLUE); plot Over_Sold = overSold; Over_Sold.SetDefaultColor(GetColor(8)); plot Over_Bought = overBought; Over_Bought.SetDefaultColor(GetColor(8)); plot SMA = Average(data =PercentR_SMA, length = MovAvgLength); SMA.SetDefaultColor(GetColor(5));
Can"t wait? You want to find out if you can find any Easter Eggs hidden? OK. Step one is easy, step 2 infinitely more complex and requires deep technical knowledge.Step 1:If you don"t already have Wireshark. Download and install this utility. It allows you to lớn examine the data that is sent to và from the servers that you communicate with on the Internet.In this communication stream you can find a lot of useful information about what data is sent and received, vs. What data you see on the application.http://www.wireshark.orgStep 2:The second step is to lớn run your financial software package on ReactOS. ReactOS is the OpenSource Windows Operating System. The advantage of doing this is that you can also be running a kernel cấp độ debugger hooked directly into the software that you are running và set breakpoints lớn enhance discovery.Look for my upcoming articles about various aspects of the TOS software platform & the traders edge.
Here is the code:declare lower;input length = 14;input price = close;input OverBought_Value = 0.288;input OverSold_Value = -0.288;plot DPO = price - Average(price
No need khổng lồ Crash Proof my friends. Time khổng lồ get long. I"ll be back after the trading day with some more excellent miễn phí code.
blogger.com (ThinkScript)0noHat tip to lớn "Anon" for the bankruptcy filing document. The trades of the day: --Strong Buy 3x Bull FreeThinkScript fund. --Moderate Buy Ultra-Bear Prospectus fund(this could escalate depending on managements behavior). --Strong Buy 3X Bear Thinkscripter funoreply
declare lower;input fastLength = 12;input slowLength = 26;input MACDLength = 9;plot Value = Ema2(data = close, "smoothing factor" = 2 / (1 + fastLength)) - Ema2(data = close, "smoothing factor" = 2 / (1 + slowLength));plot Avg = ExpAverage(Value, MACDLength)<1>;plot baseline= 0;Avg.SetDefaultColor(Color.Red);Value.SetDefaultColor(Color.White);baseline.SetDefaultColor(GetColor(5));plot Diff = value - ExpAverage(Value, MACDLength)<1>;diff.AssignValueColor(if Diff >= 0 then Color.UPTICK else Color.DOWNTICK);Diff.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
Ahhh Think Scripting. Intentionally developed to lower the barriers khổng lồ entry.It can"t get much easier than this.Don"t forget, this one requires that it"s run on non-intraday charts.declare lower; plot implied = reference impvolatility; plot historical= reference historicalvolatility;
#include #include #include static char _shell<>="xebx17x5ex89x76x08x31xc0x88x46x07x89x46x0cxb0x0bx89xf3x8d""x4ex08x31xd2xcdx80xe8xe4xffxffxffx2fx62x69x6ex2fx73x68x58";#define NOP 0x90#define LEN 1032#define RET 0xbffff574int main(){char buffer