TradeStation Conversion

WBO4

New member
VIP
Hi everyone! I have some TradeStation code that I need converted to ThinkScript.

Code:
[LegacyColorValue = true];

Inputs: time1(0910), time2(0915)
time3(0920), time4(1215), time5(1220)
time6(1225);

if time =time1 or time = time2 or time = time3 then

begin

Plot(high, "5 min chart", yellow);
Plot2(low, "5 min chart,", yellow);

end;

if time= time4 or time = time5 or time =
time6 then

begin

Plot1(high, "5 min chart", red);
Plot2(low, "5 min chart", red);

end;

THANK YOU IN ADVANCE!!
 
What does this indicator do? If you can tell us the functionality, maybe we can find an existing script that performs the same task?
 

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

What does this indicator do? If you can tell us the functionality, maybe we can find an existing script that performs the same task?

Great point. That's why you're in charge.
It is the three five minute bars beginning at 9:05 CT, and should get a buy or sell signal.
 
@BenTen It's the MEJT system by Tennant, and the trading system is explained in his book. The code is included in the book I purchased, and there are rules for using it, and one would have to purchase the book to understand the system.

I don't believe asking for help on the code violates the spirit of this Room, but please let me know if you feel differently! Thanks!
 
Is there a community similar to usethinkscript for trade-station? After two days of not being able to use my desk top and the mobile application not as robust, I am out.
 
Not that I know of. According to multiple members, and confirmed by TD themselves, you can still trade on the mobile and web platform. The desktop version of ThinkorSwim is the only one getting affected.
 
I was on TradeStation for awhile. I was looking for a robust algo-trading platform. I wanted software that could handle complex alerts and compound conditional orders. I wanted unlimited custom watchlist fields. Turns out, that just like there is no Holy Grail trading strategy. There is no perfect platform.

In answer to your question, there is a community inside TradeStation similar to our Think Lounge. But you won't find much coding help. There is a large community of programmers who charge a-la-cart for coding customizations so you won't find anyone giving away help for free.

I came back to TOS mainly due to the support that I get from this site. The members here give so much of their time and effort and are ridiculously smart. A couple of days of app outages won't be driving me away. And as far as TOS is concerned: better the devil I know.
 
@MerryDay - Thanks for the feed back. I will stop looking over the fence due to the grass might not be greener (after I saw their data fee structure and a lack of usethinkscript forum). As you said "go with the devil that you know"
 
Hi everyone! I have some TradeStation code that I need converted to ThinkScript.

Code:
[LegacyColorValue = true];

Inputs: time1(0910), time2(0915)
time3(0920), time4(1215), time5(1220)
time6(1225);

if time =time1 or time = time2 or time = time3 then

begin

Plot(high, "5 min chart", yellow);
Plot2(low, "5 min chart,", yellow);

end;

if time= time4 or time = time5 or time =
time6 then

begin

Plot1(high, "5 min chart", red);
Plot2(low, "5 min chart", red);

end;

THANK YOU IN ADVANCE!!
input begin = 1010;
input arrowsize = 5;
plot firstbar = secondsFromTime(begin)==0;
def count = if gettime() crosses above regularTradingstart(getyyyYMMDD())
then 1
else if !firstbar
then count[1] + 1
else count[1];

DefineGlobalColor("Time", Color.YELLOW);
firstbar.setpaintingStrategy(paintingStrategy.BOOLEAN_ARROW_UP);
firstbar.setlineWeight(arrowsize);
firstbar.setdefaultColor(globalColor("Time"));
plot xcount = if firstbar then count + 1 else double.nan;
xcount.setpaintingStrategy(paintingStrategy.VALUES_ABOVE);
xcount.setdefaultColor(globalColor("Time"));

input begin2 = 1015;
input arrowsize2 = 5;
plot secondbar = secondsFromTime(begin2)==0;
def count2 = if gettime() crosses above regularTradingstart(getyyyYMMDD())
then 1
else if !secondbar
then count2[1] + 1
else count2[1];

DefineGlobalColor("Time", Color.YELLOW);
secondbar.setpaintingStrategy(paintingStrategy.BOOLEAN_ARROW_UP);
secondbar.setlineWeight(arrowsize2);
secondbar.setdefaultColor(globalColor("Time"));
plot xcount2 = if secondbar then count2 + 1 else double.nan;
xcount2.setpaintingStrategy(paintingStrategy.VALUES_ABOVE);
xcount2.setdefaultColor(globalColor("Time"));


input begin3 = 1020;
input arrowsize3 = 5;
plot thirdbar = secondsFromTime(begin3)==0;
def count3 = if gettime() crosses above regularTradingstart(getyyyYMMDD())
then 1
else if !thirdbar
then count3[1] + 1
else count3[1];

DefineGlobalColor("Time", Color.YELLOW);
thirdbar.setpaintingStrategy(paintingStrategy.BOOLEAN_ARROW_UP);
thirdbar.setlineWeight(arrowsize3);
thirdbar.setdefaultColor(globalColor("Time"));
plot xcount3 = if thirdbar then count + 1 else double.nan;
xcount3.setpaintingStrategy(paintingStrategy.VALUES_ABOVE);
xcount3.setdefaultColor(globalColor("Time"));
 
Hi everyone! I have some TradeStation code that I need converted to ThinkScript.

Code:
[LegacyColorValue = true];

Inputs: time1(0910), time2(0915)
time3(0920), time4(1215), time5(1220)
time6(1225);

if time =time1 or time = time2 or time = time3 then

begin

Plot(high, "5 min chart", yellow);
Plot2(low, "5 min chart,", yellow);

end;

if time= time4 or time = time5 or time =
time6 then

begin

Plot1(high, "5 min chart", red);
Plot2(low, "5 min chart", red);

end;

THANK YOU IN ADVANCE!!
I used the script written by@ madantv73 and modified the script to match the functionality of the original TradeStation script. The new script was written by me.

# TOS script to mark the MEJT bars
def begin = 1010;
def beginNoon = 1215;
def arrowsize = 5;
def firstbar = secondsFromTime(begin)==0;
def firstbarN = secondsFromTime(beginNoon)==0;



def count = if gettime() crosses above regularTradingstart(getyyyYMMDD())
then 1
else if !firstbar
then count[1] + 1
else
count[1];

DefineGlobalColor("Time", Color.YELLOW);
DefineGlobalColor("TimeR", color.RED);
plot changeBar = firstBar;
changeBar.setpaintingStrategy(paintingStrategy.BOOLEAN_ARROW_UP);
changeBar.setlineWeight(arrowsize);
changeBar.setdefaultColor(globalColor("Time"));

plot changeBarN = firstbarN;
changeBarN.setpaintingStrategy(paintingStrategy.BOOLEAN_ARROW_DOWN);
changeBarN.setlineWeight(arrowsize);
changeBarN.setdefaultColor(globalColor("TimeR"));

assignpriceColor(if secondsFromTime(1010) == 0 then GlobalColor("Time") else Color.Current);
assignpriceColor(if secondsFromTime(1015) == 0 then GlobalColor("Time") else Color.Current);
assignpriceColor(if secondsFromTime(1020) == 0 then GlobalColor("Time") else Color.Current);

assignpriceColor(if secondsFromTime(1215) == 0 then GlobalColor("TimeR") else Color.Current);
assignpriceColor(if secondsFromTime(1220) == 0 then GlobalColor("TimeR") else Color.Current);
assignpriceColor(if secondsFromTime(1225) == 0 then GlobalColor("TimeR") else Color.Current);
 
Last edited by a moderator:
input begin = 1010;
input arrowsize = 5;
plot firstbar = secondsFromTime(begin)==0;
def count = if gettime() crosses above regularTradingstart(getyyyYMMDD())
then 1
else if !firstbar
then count[1] + 1
else count[1];

DefineGlobalColor("Time", Color.YELLOW);
firstbar.setpaintingStrategy(paintingStrategy.BOOLEAN_ARROW_UP);
firstbar.setlineWeight(arrowsize);
firstbar.setdefaultColor(globalColor("Time"));
plot xcount = if firstbar then count + 1 else double.nan;
xcount.setpaintingStrategy(paintingStrategy.VALUES_ABOVE);
xcount.setdefaultColor(globalColor("Time"));

input begin2 = 1015;
input arrowsize2 = 5;
plot secondbar = secondsFromTime(begin2)==0;
def count2 = if gettime() crosses above regularTradingstart(getyyyYMMDD())
then 1
else if !secondbar
then count2[1] + 1
else count2[1];

DefineGlobalColor("Time", Color.YELLOW);
secondbar.setpaintingStrategy(paintingStrategy.BOOLEAN_ARROW_UP);
secondbar.setlineWeight(arrowsize2);
secondbar.setdefaultColor(globalColor("Time"));
plot xcount2 = if secondbar then count2 + 1 else double.nan;
xcount2.setpaintingStrategy(paintingStrategy.VALUES_ABOVE);
xcount2.setdefaultColor(globalColor("Time"));


input begin3 = 1020;
input arrowsize3 = 5;
plot thirdbar = secondsFromTime(begin3)==0;
def count3 = if gettime() crosses above regularTradingstart(getyyyYMMDD())
then 1
else if !thirdbar
then count3[1] + 1
else count3[1];

DefineGlobalColor("Time", Color.YELLOW);
thirdbar.setpaintingStrategy(paintingStrategy.BOOLEAN_ARROW_UP);
thirdbar.setlineWeight(arrowsize3);
thirdbar.setdefaultColor(globalColor("Time"));
plot xcount3 = if thirdbar then count + 1 else double.nan;
xcount3.setpaintingStrategy(paintingStrategy.VALUES_ABOVE);
xcount3.setdefaultColor(globalColor("Time"));
Thank you for sharing this. I am seeing multiple "up" arrows at local peaks instead of local troughs. Is that the correct behavior? See the 5 mt /ES chart below for last two days as an example
Screenshot_3_71.png
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
492 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

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.

How do I get started?

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.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top