Dark Theme
Light Theme
Trading Articles
Article Categories
Article Tools
Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to
register in order to view the content of the threads and start contributing to our community.
It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
Updated November 22, 2016
Top Posters
looks_one
RedK
with 8 posts (3 thanks)
looks_two
sboarder13
with 6 posts (1 thanks)
looks_3
mightyatom
with 3 posts (0 thanks)
looks_4
Quick Summary
with 1 posts (0 thanks)
Best Posters
looks_one
GeorgeCgI
with 1 thanks per post
looks_two
esslash
with 1 thanks per post
looks_3
RedK
with 0.4 thanks per post
looks_4
sboarder13
with 0.2 thanks per post
trending_up
28,150 views
thumb_up
6 thanks given
group
9 followers
forum
20 posts
attach_file
6 attachments
September 26th, 2012, 05:09 PM
Washington DC United States
Posts: 6 since Aug 2012
Thanks Given: 0
Thanks Received: 1
I am curious if someone can convert this easy language code into Thinkorswim Thinkscript code for me?
Attached Files
Elite Membership required to download: WAVEDOTS.ELD
Can you help answer these questions from other members on NexusFi?
Best Threads (Most Thanked) in the last 7 days on NexusFi
September 27th, 2012, 07:44 AM
Dubai, UAE
Experience: Intermediate
Platform: TOS, TradeStation
Broker: OX, TradeStation
Trading: Stocks & Basic Options
Posts: 171 since May 2012
Thanks Given: 44
Thanks Received: 145
Hi sboarder13,
can you include the code, or attach as .txt, and a quick description of what it does,
thx, RedK
September 27th, 2012, 04:33 PM
Washington DC United States
Posts: 6 since Aug 2012
Thanks Given: 0
Thanks Received: 1
Code
Input:
Length1 (20),
Length2(50),
Length3(100),
ST_MA_Color(Yellow),
MT_MA_Color(Cyan),
LT_MA_Color(Magenta),
Dot_Size (3),
LineSize(1);
Var: MA1(0),MA2(0),MA3(0);
MA1 = XAverage(MBC,Length1);
MA2 = XAverage(MBC,Length2);
MA3 = XAverage(MBC,Length3);
var:HiDisp(0),LoDisp(0),DispDiff(0);
HiDisp = GetAppInfo (aiHighestDispValue);
LoDisp = GetAppInfo (aiLowestDispValue);
DispDiff = HiDisp - LoDisp;
// for longs
Var: LongLevel1(0),LongLevel2(0),LongLevel3(0);
LongLevel1 = LoDisp + DispDiff*.16;
LongLevel2 = LoDisp + DispDiff*.13;
LongLevel3 = LoDisp + DispDiff*.10;
// for shorts
Var: ShortLevel1(0),ShortLevel2(0),ShortLevel3(0);
ShortLevel1 = LoDisp + DispDiff*.90;
ShortLevel2 = LoDisp + DispDiff*.87;
ShortLevel3 = LoDisp + DispDiff*.84;
If MA1 > MA1[1] then Plot1(LongLevel1,"ST-L.dot",ST_MA_Color, default,Dot_Size)else Noplot(1);
If MA2 > MA2[1] then Plot2(LongLevel2,"MT-L.dot",MT_MA_Color, default,Dot_Size)else Noplot(2);
If MA3 > MA3[1] then Plot3(LongLevel3,"LT-L.dot",LT_MA_Color,default,Dot_Size)else Noplot(3);
If MA1 < MA1[1] then Plot4(ShortLevel1,"ST-S.dot",ST_MA_Color, default,Dot_Size)else Noplot(4);
If MA2 < MA2[1] then Plot5(ShortLevel2,"MT-S.dot",MT_MA_Color, default,Dot_Size)else Noplot(5);
If MA3 < MA3[1] then Plot6(ShortLevel3,"LT-S.dot",LT_MA_Color,default,Dot_Size)else Noplot(6);
September 27th, 2012, 04:35 PM
Washington DC United States
Posts: 6 since Aug 2012
Thanks Given: 0
Thanks Received: 1
here is a screenshot of how it plots
September 27th, 2012, 04:48 PM
Dubai, UAE
Experience: Intermediate
Platform: TOS, TradeStation
Broker: OX, TradeStation
Trading: Stocks & Basic Options
Posts: 171 since May 2012
Thanks Given: 44
Thanks Received: 145
thanks .. that's the same concept in K_Trender (Elite section).. tracking price against a set of 3 MA's of varying lengths..
the visualization is different though (you just see a dot when the price crosses one of them - 3 different levels) where in K_Trender we also get 2 momentum lines (Fast & Slow) out of these MA's..
should be easy to do in ToS ..
will get back to you,
RedK
September 27th, 2012, 05:43 PM
Dubai, UAE
Experience: Intermediate
Platform: TOS, TradeStation
Broker: OX, TradeStation
Trading: Stocks & Basic Options
Posts: 171 since May 2012
Thanks Given: 44
Thanks Received: 145
there you go .. added an option to show/hide the MA's ..
hope this helps,
RedK
Code
input ShortLength = 20;
input MedLength = 50;
input LongLength = 100;
input price = Close;
Input Showlines = No;
Plot MA1 = ExpAverage(price, ShortLength);
Plot MA2 = ExpAverage(price, MedLength);
Plot MA3 = ExpAverage(price, LongLength);
# format the lines and option to show/hide
MA1.setdefaultColor (color.yellow); MA1.sethiding(!ShowLines);
MA2.setdefaultColor (color.Cyan); MA2.sethiding(!ShowLines);
MA3.setdefaultColor (color.Magenta); MA3.sethiding(!ShowLines);
#calc screen area for plot and assign plot levels
def LongLevel = HighestAll (high) * 1.05;
def ShortLevel = LowestAll(low) * 0.95;
def DispDiff = LongLevel - ShortLevel;
def LongL1 = LongLevel - DispDiff * 0.09;
def LongL2 = LongLevel - DispDiff * 0.05;
def LongL3 = LongLevel - DispDiff * 0.01;
def ShortL1 = ShortLevel + DispDiff * 0.02;
def ShortL2 = ShortLevel + DispDiff * 0.04;
def ShortL3 = ShortLevel + DispDiff * 0.06;
# plot the dot if the corresponding MA is going up .. for Longs
plot LongLevel1 = if MA1 > MA1[1] then LongL1 else Double.NaN;
plot LongLevel2 = if MA2 > MA2[1] then LongL2 else Double.NaN;
plot LongLevel3 = if MA3 > MA3[1] then LongL3 else Double.NaN;
LongLevel1.SetPaintingStrategy (PaintingStrategy.SQUARES);
LongLevel1.SetDefaultColor(Color.YELLOW);
LongLevel1.SetLineWeight (2);
LongLevel2.SetPaintingStrategy (PaintingStrategy.SQUARES);
LongLevel2.SetDefaultColor(Color.CYAN);
LongLevel2.SetLineWeight (2);
LongLevel3.SetPaintingStrategy (PaintingStrategy.SQUARES);
LongLevel3.SetDefaultColor(Color.MAGENTA);
LongLevel3.SetLineWeight (2);
# plot the dot if the corresponding MA is going down .. for shorts
plot ShortLevel1 = if MA1 < MA1[1] then ShortL1 else Double.NaN;
plot ShortLevel2 = if MA2 < MA2[1] then ShortL2 else Double.NaN;
plot ShortLevel3 = if MA3 < MA3[1] then ShortL3 else Double.NaN;
ShortLevel1.SetPaintingStrategy (PaintingStrategy.SQUARES);
ShortLevel1.SetDefaultColor(Color.YELLOW);
ShortLevel1.SetLineWeight (2);
ShortLevel2.SetPaintingStrategy (PaintingStrategy.SQUARES);
ShortLevel2.SetDefaultColor(Color.CYAN);
ShortLevel2.SetLineWeight (2);
ShortLevel3.SetPaintingStrategy (PaintingStrategy.SQUARES);
ShortLevel3.SetDefaultColor(Color.MAGENTA);
ShortLevel3.SetLineWeight (2);
September 27th, 2012, 05:48 PM
Dubai, UAE
Experience: Intermediate
Platform: TOS, TradeStation
Broker: OX, TradeStation
Trading: Stocks & Basic Options
Posts: 171 since May 2012
Thanks Given: 44
Thanks Received: 145
although i would use this a little differently .. i would build the singals (the dots) in a way that when price goes above the short MA, i get 1st dot, then above 2nd MA, I get 2nd dot, then above 3rd MA i get a 3rd dot - and that means a full uptrend formation .. same going down ..
but i kept it the way it is.. thx,
RedK
September 28th, 2012, 10:19 AM
Washington DC United States
Posts: 6 since Aug 2012
Thanks Given: 0
Thanks Received: 1
Hey I appreciate it the only thing I see though is that in an uptrend like the chart you have posted the dots are on the top instead of on the bottom essentially meaning support. Anyway you could change this around?
September 28th, 2012, 10:31 AM
Washington DC United States
Posts: 6 since Aug 2012
Thanks Given: 0
Thanks Received: 1
I plotted this on a 5minute chart of the /YM and the plots are way above and below price in order to see them the chart is unreadable. Here is an example of what I get when putting them on a daily AAPL chart which is different than yours.
Last Updated on November 22, 2016