Convert Easy Language code into Thinkscript - ThinkOrSwim | futures io social day trading
futures io futures trading


Convert Easy Language code into Thinkscript
Updated: Views / Replies:8,384 / 20
Created: by sboarder13 Attachments:6

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Reply
 6  
 
Thread Tools Search this Thread
 

Convert Easy Language code into Thinkscript

  #1 (permalink)
Trading Apprentice
Washington DC United States
 
Futures Experience: Advanced
Platform: Tradestation, TOS
Favorite Futures: ES,NQ,YM,GC,CL,Z,
 
Posts: 6 since Aug 2012
Thanks: 0 given, 1 received

Convert Easy Language code into Thinkscript

I am curious if someone can convert this easy language code into Thinkorswim Thinkscript code for me?

Attached Files
Register to download File Type: eld WAVEDOTS.ELD (12.4 KB, 54 views)
Reply With Quote
 
  #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

 
  #3 (permalink)
Knowledge Seeker
Dubai, UAE
 
Futures Experience: Intermediate
Platform: TOS, TradeStation
Broker/Data: OX, TradeStation
Favorite Futures: Stocks & Basic Options
 
RedK's Avatar
 
Posts: 171 since May 2012
Thanks: 44 given, 138 received


Hi sboarder13,
can you include the code, or attach as .txt, and a quick description of what it does,

thx, RedK

Reply With Quote
 
  #4 (permalink)
Trading Apprentice
Washington DC United States
 
Futures Experience: Advanced
Platform: Tradestation, TOS
Favorite Futures: ES,NQ,YM,GC,CL,Z,
 
Posts: 6 since Aug 2012
Thanks: 0 given, 1 received

 
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);

Reply With Quote
 
  #5 (permalink)
Trading Apprentice
Washington DC United States
 
Futures Experience: Advanced
Platform: Tradestation, TOS
Favorite Futures: ES,NQ,YM,GC,CL,Z,
 
Posts: 6 since Aug 2012
Thanks: 0 given, 1 received

here is a screenshot of how it plots

Attached Thumbnails
Convert Easy Language code into Thinkscript-screen-shot-2012-09-18-8.50.09-pm.png  
Reply With Quote
 
  #6 (permalink)
Knowledge Seeker
Dubai, UAE
 
Futures Experience: Intermediate
Platform: TOS, TradeStation
Broker/Data: OX, TradeStation
Favorite Futures: Stocks & Basic Options
 
RedK's Avatar
 
Posts: 171 since May 2012
Thanks: 44 given, 138 received

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

Reply With Quote
 
  #7 (permalink)
Knowledge Seeker
Dubai, UAE
 
Futures Experience: Intermediate
Platform: TOS, TradeStation
Broker/Data: OX, TradeStation
Favorite Futures: Stocks & Basic Options
 
RedK's Avatar
 
Posts: 171 since May 2012
Thanks: 44 given, 138 received

there you go .. added an option to show/hide the MA's ..
hope this helps,
RedK

Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).


 
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);

Reply With Quote
The following 2 users say Thank You to RedK for this post:
 
  #8 (permalink)
Knowledge Seeker
Dubai, UAE
 
Futures Experience: Intermediate
Platform: TOS, TradeStation
Broker/Data: OX, TradeStation
Favorite Futures: Stocks & Basic Options
 
RedK's Avatar
 
Posts: 171 since May 2012
Thanks: 44 given, 138 received

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

Reply With Quote
 
  #9 (permalink)
Trading Apprentice
Washington DC United States
 
Futures Experience: Advanced
Platform: Tradestation, TOS
Favorite Futures: ES,NQ,YM,GC,CL,Z,
 
Posts: 6 since Aug 2012
Thanks: 0 given, 1 received

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?

Reply With Quote
 
  #10 (permalink)
Trading Apprentice
Washington DC United States
 
Futures Experience: Advanced
Platform: Tradestation, TOS
Favorite Futures: ES,NQ,YM,GC,CL,Z,
 
Posts: 6 since Aug 2012
Thanks: 0 given, 1 received


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.

Attached Thumbnails
Convert Easy Language code into Thinkscript-aapldaily.png  
Reply With Quote

Reply



futures io > > > > Convert Easy Language code into Thinkscript

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Easy Language code question quantismo EasyLanguage Programming 3 April 3rd, 2012 09:36 PM
convert metatrader indicators to easy language for multicharts kdmezz EasyLanguage Programming 1 May 10th, 2011 07:45 PM
easy language ..not easy... Serger EasyLanguage Programming 4 April 26th, 2011 04:42 PM
MC: Simple strategy code problem / Easy Language true EasyLanguage Programming 4 December 19th, 2010 09:48 AM


All times are GMT -4. The time now is 04:40 PM.

Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts
Page generated 2017-12-18 in 1.66 seconds with 20 queries on phoenix via your IP 54.221.136.62