NexusFi: Find Your Edge


Home Menu

 





ThinkScript (TOS) Programming Question


Discussion in ThinkOrSwim

Updated
      Top Posters
    1. looks_one Pharmakon with 2 posts (0 thanks)
    2. looks_two Quick Summary with 1 posts (0 thanks)
    3. looks_3 oztrd with 1 posts (2 thanks)
    4. looks_4 kojava with 1 posts (0 thanks)
    1. trending_up 13,911 views
    2. thumb_up 2 thanks given
    3. group 9 followers
    1. forum 10 posts
    2. attach_file 1 attachments




 
Search this Thread

ThinkScript (TOS) Programming Question

  #1 (permalink)
 Curbfeeler 
Central Iowa
 
Experience: Beginner
Platform: NinjaTrader
Posts: 22 since Nov 2009
Thanks Given: 34
Thanks Received: 16

Hi. I have a question about Thinkscript. I am not optimistic that anyone can help me, because I don't think what I want to do is possible. My strategy is a kind of swing method. I have a condition (unimportant at this point, to go into detail), and then this condition is met I want to draw two horizontal lines above and below the signal bar. I want these lines to continue until price breaks either line. I want to ignore additional signals while this signal is still in play (see picture).

Here is the problem...

When I create the "HighLine" I need to look back and see what "HighLine[1]" was (last bar compared to price). That's easy enough, but I also need to take a peek at "LowLine[1]."

The problem is this hasn't been defined in my code yet, so I can't reference it. Thinkscript does not give you any way to define a variable at the top of the code and then change it towards the bottom of the code. So for instance, if I could drop myself a little breadcrumb in ThinkScript and tell myself that the two lines had been 30 ticks apart, I'd be fine--so long as I could reference this at the top of my code later.

Maybe I am missing something. Is there anybody who has figured out a way to do something similar?

Any help is appreciated. I have a feeling I may need to draw two dots and fill the lines in manually. What a drag that will be, since I could code this whole strategy in NT is less than an hour.

Attached Thumbnails
Click image for larger version

Name:	TOS_Strategy.png
Views:	463
Size:	46.6 KB
ID:	17801  
Visit my NexusFi Trade Journal Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
What broker to use for trading palladium futures
Commodities
Quantum physics & Trading dynamics
The Elite Circle
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
About a successful futures trader who didnt know anythin …
Psychology and Money Management
 
  #3 (permalink)
 oztrd 
new york, ny
 
Experience: Beginner
Platform: Velocity, Sierracharts, TOS
Broker: Velocity/TT FIX
Trading: 6E
Posts: 21 since Aug 2010
Thanks Given: 14
Thanks Received: 5


these sites but here goes.

https://www.thinkscripter.com/

https://thinkscript.blogspot.com/

https://readtheprospectus.wordpress.com/

you should also check the forum on thinkscripter.com

good luck,


Reply With Quote
Thanked by:
  #4 (permalink)
 
kojava's Avatar
 kojava 
Orlando, FL
 
Experience: Advanced
Platform: NinjaTrader, ToS, Sierra Chart, MCDT
Broker: Interactive Brokers
Trading: ES, NQ, 6E, 6A, TF, CL
Posts: 43 since Jan 2011
Thanks Given: 53
Thanks Received: 29

Thanks for those links. They are very helpful.




Quoting 
...

you should also check the forum on thinkscripter.com

good luck,



Reply With Quote
  #5 (permalink)
 optntdr13 
Glyndon, Maryland, USA
 
Experience: Advanced
Platform: TOS
Trading: options
Posts: 24 since Sep 2010
Thanks Given: 6
Thanks Received: 49

If you expain in more detail, preferrably in English I am happy to help you figure it out.

Reply With Quote
  #6 (permalink)
 
sam1197's Avatar
 sam1197 
Canada
 
Experience: Intermediate
Platform: NT, IB
Broker: IB
Trading: Currency Futures
Posts: 55 since Feb 2011
Thanks Given: 13
Thanks Received: 12


optntdr13 View Post
If you expain in more detail, preferrably in English I am happy to help you figure it out.

Can I use your talent in modifying/writing TOS Pivot points to plot mid points? Thanks in advance.

R3
M5
R2
M4
R1
M3
Pivot Point
M2
S1
M1
S2
M0
S3

example" M1 = (S1 + S2)/2

Thanks in advance.

Visit my NexusFi Trade Journal Reply With Quote
  #7 (permalink)
DavesRisk
Cleveland, Ohio
 
Posts: 5 since Jul 2010
Thanks Given: 2
Thanks Received: 0

Here's another ThinkScript reference site:
www(DOT)share-tos.blogspot(DOT)com

The original post asked about drawing lines above/below breakout levels. Have you looked at the TOS DarvasBox Study for ideas?
I've not posted enough here to include a link, sorry.

Reply With Quote
  #8 (permalink)
mcorb
boston mass
 
Posts: 2 since Apr 2012
Thanks Given: 0
Thanks Received: 0

Hello I have a custom nt indicator fairly simple one. Is it possible to get it translated so I can see if it will work well with TOS? Itshould its not auto execute just sort of rollingaversge I dictator. Thnc

Reply With Quote
  #9 (permalink)
PowerrTrader
Calgary Canada
 
Posts: 8 since Feb 2016
Thanks Given: 3
Thanks Received: 0

thanks

Reply With Quote
  #10 (permalink)
 
Pharmakon's Avatar
 Pharmakon 
Paris France
 
Experience: Beginner
Platform: TradingView
Broker: CQG
Trading: ES1!, CL1!, DY1!
Posts: 45 since Jan 2016
Thanks Given: 119
Thanks Received: 27



oztrd View Post
these sites but here goes.

ThinkScripter Community Forum - Give Help, Get Help, Pay it Forward

Thinkorswim thinkscript library

https://readtheprospectus.wordpress.com/

you should also check the forum on thinkscripter.com

good luck,



Hi ! Thanks for these links. Do you know also a post about how start ToS Script to do automated trading on PaperMoney ?


Best Regards,
P.

Follow me on Twitter Reply With Quote




Last Updated on March 8, 2016


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
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.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts