Convert an OTA indicator from TS to ToS - ThinkOrSwim | futures io social day trading
futures io futures trading


Convert an OTA indicator from TS to ToS
Updated: Views / Replies:213 / 2
Created: by speigo Attachments:0

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 100,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

 
 
Thread Tools
 

Convert an OTA indicator from TS to ToS

 
Huntington Beach, CA, USA
 
 
Posts: 3 since May 2019
Thanks: 1 given, 0 received

Convert an OTA indicator from TS to ToS

Hi,
I have looked at the available ToS downloads and some of the threads regarding converting scripts from one platform to another. I also looked in the Online Trading Academy (OTA) posts but didn't see anything there.

I would like to convert the floating ATR capability that is a download from OTA. If anyone can help that would be great. Here is the code and the picture of what it looks like in TradeStation. Thanks in advance.

****** OTA Floating ATR
****** This tool displays the Daily ATR on the chart as well as 10% and 2% of the Daily ATR.

****** Easy Language Code
inputs: PosX( 40 ), PosY( 97 ), TextColor( Black );

var: tsdata.marketdata.PriceSeriesProvider dPSP( NULL );
method override void InitializeComponent() begin
dPSP = new tsdata.marketdata.PriceSeriesProvider;
dPSP.Symbol = GetSymbolName;
dPSP.Interval.ChartType = tsdata.marketdata.DataChartType.Bars;
dPSP.Interval.IntervalType = tsdata.marketdata.DataIntervalType.Daily;
dPSP.Interval.IntervalSpan = 1;
dPSP.Interval.Name = "(Unknown name)";
dPSP.Range.Type = tsdata.marketdata.DataRangeType.Months;
dPSP.Range.Months = 2;
dPSP.Range.Name = "(Unknown name)";
dPSP.IncludeVolumeInfo = false;
dPSP.IncludeTicksInfo = false;
//dPSP.UseNaturalHours = false;
dPSP.Realtime = true;
//dPSP.TimeZone = tsdata.common.TimeZone.exchange;
dPSP.Load = true;
dPSP.Name = "dPSP";
end;

vars: IntrabarPersist FirstTickOfBar( False ),
x( 0 ), ATR( 0 ), HalfATR( 0 ), QuarterATR( 0 ), TenthATR( 0 ), TwoPctATR( 0 ), ATRText( 0 ), Dec( 0 ), Add( 0 );


ATR = 0;
for x = 0 to 13 begin
if dPSP.Count > 14 then
ATR = ATR + ( iff(dPSP.Close[x+1] astype double > dPSP.High[x] astype double, dPSP.Close[x+1] astype double, dPSP.High[x] astype double)
- iff(dPSP.Close[x+1] astype double < dPSP.Low[x] astype double, dPSP.Close[x+1] astype double, dPSP.Low[x] astype double) );
end;
ATR = ATR / 14;

if Category = 2 then Dec = 2
else if Category = 12 then begin if MidStr(Symbol, 4, 3) = "JPY" then ATR = ATR * 100 else ATR = ATR * 10000; Dec = 0; end
else if Category = 0 then
if SymbolRoot="EC" OR SymbolRoot="JY" OR SymbolRoot="BP" OR SymbolRoot="AD" OR SymbolRoot="CD" OR SymbolRoot="SF" then begin ATR = ATR * 10000; Dec = 0; end
else Dec = 3;
if Dec = 0 then Add = 1 else Add = MinMove * 0.01;
HalfATR = (Round((ATR*0.5/Add),0)+1) * Add; QuarterATR = (Round((ATR*0.25/Add),0)+1) * Add; TenthATR = (Round((ATR*0.1/Add),0)+1) * Add; TwoPctATR = (Round((ATR*0.02/Add),0)+1) * Add;

if ATRText <> 0 AND FirstTickOfBar then Value1 = Text_Delete( ATRText );
ATRText = Text_New( Date, Time, Close, "[dATR]:"+NumToStr(ATR,Dec)+" [10%]:"+NumToStr(TenthATR,Dec)+" [2%]:"+NumToStr(TwoPctATR,Dec) );
Value1 = Text_SetColor( ATRText, TextColor ); Value1 = Text_Float( ATRText, PosX, PosY );

FirstTickOfBar = BarStatus(1) = 2;


Last edited by speigo; May 25th, 2019 at 02:21 PM.
 
 
Seattle, WA/USA
 
Trading Experience: Intermediate
Platform: TOS, TS
Favorite Futures: Forex, crude
 
Posts: 39 since Sep 2016
Thanks: 6 given, 14 received

There are some ATR labels available for free on the interwebs that might do the trick. No screenshot, so not sure if this will work for ya, but try this one:

 
Code
input ATRLength = 14;
def ATR = Round(AvgTrueRange(high, close, low, ATRLength), 2);
def ATR10 = ATR * .1;
def ATR02 = ATR * .02;
addLabel(yes,concat(“ATR=”, ATR), color.Yellow);
addLabel(yes,concat(” ATR10=”, ATR10), color.White);
addLabel(yes,concat(” ATR02=”, ATR02), color.Green);

Follow me on Twitter
The following user says Thank You to kjhosken for this post:
 
 
Huntington Beach, CA, USA
 
 
Posts: 3 since May 2019
Thanks: 1 given, 0 received


Thank you for the response. I will give this code a try.


 



futures io > > > > Convert an OTA indicator from TS to ToS
Thread Tools



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

futures io is celebrating 10-years w/ over $18,000 in prizes!

Right now
 

$1,000 in Amazon Gift Cards being given away right now from GFF Brokers

Right now
 

$250 Amazon Gift Cards with our "Thanks Contest" challenge!

Right now
 

Show us your trading desks and win over $5,000 in prizes w/Jigsaw Trading

August
 

Webinar: AutoTrading World Cup Advisor w/GFF Brokers

Aug 22
 

Webinar: Suri Duddella (TBA)

Elite only
 

Webinar: Richard Bailey (TBA)

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Ota's Trading Journal Ota Trader Trading Journals 12 June 8th, 2014 02:24 PM
looking for someone to convert the PBFSqueeze indicator from NT to TOS Hguru ThinkOrSwim 0 May 3rd, 2013 06:35 PM
Looking for someone to convert Big Mikes Volume Graph Study for TOS Hguru ThinkOrSwim 0 January 10th, 2013 05:43 PM
Can anyone convert a code from TOS j8fire ThinkOrSwim 8 July 18th, 2012 08:24 PM


All times are GMT -4. The time now is 12:37 AM. (this page content is cached, log in for real-time version)

Copyright © 2019 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