NexusFi: Find Your Edge


Home Menu

 





help code multiple Time Frame indicator


Discussion in ThinkOrSwim

Updated
      Top Posters
    1. looks_one zentrade with 6 posts (2 thanks)
    2. looks_two onnb with 6 posts (1 thanks)
    3. looks_3 druM3 with 3 posts (0 thanks)
    4. looks_4 Xav1029 with 2 posts (0 thanks)
      Best Posters
    1. looks_one jdella with 1 thanks per post
    2. looks_two Big Mike with 0.5 thanks per post
    3. looks_3 zentrade with 0.3 thanks per post
    4. looks_4 onnb with 0.2 thanks per post
    1. trending_up 41,607 views
    2. thumb_up 5 thanks given
    3. group 9 followers
    1. forum 25 posts
    2. attach_file 1 attachments




 
Search this Thread

help code multiple Time Frame indicator

  #1 (permalink)
ttmarok
New York U.S
 
Posts: 4 since Jul 2011
Thanks Given: 3
Thanks Received: 0

Please help code Multiple Time Frame for EMA. I want the ema as follow;

1. My chart is 5 minutes time frame
2. I want 30 minute ema and 60 minute ema on the 5 minute charts.

Thanks

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
NexusFi Journal Challenge - April 2024
Feedback and Announcements
ZombieSqueeze
Platforms and Indicators
New Micros: Ultra 10-Year & Ultra T-Bond -- Live Now
Treasury Notes and Bonds
Futures True Range Report
The Elite Circle
Better Renko Gaps
The Elite Circle
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
61 thanks
Funded Trader platforms
39 thanks
NexusFi site changelog and issues/problem reporting
26 thanks
The Program
18 thanks
Battlestations: Show us your trading desks!
18 thanks
  #2 (permalink)
 
jdella's Avatar
 jdella 
Concord, NH USA
 
Experience: Intermediate
Platform: Ninja trader
Broker: AMP/CQG
Trading: ES
Posts: 182 since Jun 2009
Thanks Given: 140
Thanks Received: 115


ttmarok View Post
Please help code Multiple Time Frame for EMA. I want the ema as follow;

1. My chart is 5 minutes time frame
2. I want 30 minute ema and 60 minute ema on the 5 minute charts.

Thanks

I believe this is what you are looking for:

Reply With Quote
Thanked by:
  #3 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,396 since Jun 2009
Thanks Given: 33,172
Thanks Received: 101,537



jdella View Post
I believe this is what you are looking for:

I think he is looking for ThinkOrSwim only.

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #4 (permalink)
ttmarok
New York U.S
 
Posts: 4 since Jul 2011
Thanks Given: 3
Thanks Received: 0

Please help.

1. Can thinkorSwim program multi time frame ?

I search the web and can't seem to find any source or information on how to program multi time frame in TOS.

Thanks

Reply With Quote
  #5 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,396 since Jun 2009
Thanks Given: 33,172
Thanks Received: 101,537


ttmarok View Post
Please help.

1. Can thinkorSwim program multi time frame ?

I search the web and can't seem to find any source or information on how to program multi time frame in TOS.

Thanks

Have you asked ThinkOrSwim directly if it is even possible?

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
  #6 (permalink)
 
zentrade's Avatar
 zentrade 
Wilson, NC
 
Experience: Intermediate
Platform: thinkorswim
Trading: NQ
Posts: 18 since Dec 2010
Thanks Given: 1
Thanks Received: 5

Is this what you are looking for? I just took the stock Exponential moving avg script and added input for a new time period. I think it would be better if you could gather the OHLC info using the rec statement, but this works fine.

BTW, if anyone knows how to do this using the "rec" statement please let me know.

Attached Files
Elite Membership required to download: MTF_MovAvgExponentialSTUDY.ts
Reply With Quote
  #7 (permalink)
 optntdr13 
Glyndon, Maryland, USA
 
Experience: Advanced
Platform: TOS
Trading: options
Posts: 24 since Sep 2010
Thanks Given: 6
Thanks Received: 49

I know how but I am not sure I understand what you want to do exactly. If you just want to use OHLC as an input for price rather than close, then that wouldn't require a rec variable to do so. Help me understand exactly what you mean and I'll code it for you in a matter of seconds

Reply With Quote
  #8 (permalink)
 onnb 
Vancouver, Canada
Onn
 
Experience: Intermediate
Platform: NinjaTrader, SierraCharts, thinkorswim
Trading: Stocks
Posts: 10 since Sep 2011
Thanks Given: 0
Thanks Received: 3

it is possible. look under the section called
Referencing Secondary Aggregation

in the ToS thinkscript manual

here is an excerpt:

In order to access data of a different aggregation period in your code, specify the period parameter using the corresponding Aggregation Period constant. You can also use a pre-defined string value for this purpose: 1 min, 2 min, 3 min, 4 min, 5 min, 10 min, 15 min, 20 min, 30 min, 1 hour, 2 hours, 4 hours, Day, 2 Days, 3 Days, 4 Days, Week, Month, Opt Exp, and <current period>.

notice that the time period you want to reference must be greater than the time period on your chart. e.g., you can't reference 5 min data on a 30 min chart but i don't think that that is a problem in the case described here

your code would look something like this:

def a = Average(close(period = AggregationPeriod.FIVE_MIN));i would have provided the link to the documentation but i am new here and can't post links (yet)

sorry for the inconvenience.

Onn

Reply With Quote
Thanked by:
  #9 (permalink)
 
Rad4633's Avatar
 Rad4633 
Greensboro NC
 
Experience: Advanced
Platform: TOS/ NT Dorman
Trading: ES TF CL
Posts: 1,357 since Sep 2011
Thanks Given: 2,657
Thanks Received: 894


ttmarok View Post
Please help code Multiple Time Frame for EMA. I want the ema as follow;

1. My chart is 5 minutes time frame
2. I want 30 minute ema and 60 minute ema on the 5 minute charts.

Thanks

Thinkscripter.com

Visit my NexusFi Trade Journal Reply With Quote
  #10 (permalink)
 
zentrade's Avatar
 zentrade 
Wilson, NC
 
Experience: Intermediate
Platform: thinkorswim
Trading: NQ
Posts: 18 since Dec 2010
Thanks Given: 1
Thanks Received: 5



optntdr13 View Post
I know how but I am not sure I understand what you want to do exactly. If you just want to use OHLC as an input for price rather than close, then that wouldn't require a rec variable to do so. Help me understand exactly what you mean and I'll code it for you in a matter of seconds

I would like to (using a rec variable) from a 1min chart, gather the OHLC that would make a 30min bar. For example. if the time is 10:24, (1) get the CLOSE of the 10:24 1min bar, this is the close of the 30min bar. (2) from time 10:00 to 10:24 find the HIGH and LOW. (3) get the OPEN from the 10:00 1 min bar. This would be the same as if you had a 30min chart open in a seperate pane. Then you can use the rec variable like... anchorClose[1] or anchorClose[2] or anchorHigh[1] or anchorLow[3] etc to calculate a higher time frame anchor indicator that you can use on a smaller chart.

I hope that wasn't confusing. Basically I want to see a 30min or 15min stochastics on a 1 or 5 min chart but be able to change the period to 10, 15, 30, 60 etc (a multitimeframe stochastics indicator)

Thanks

Reply With Quote




Last Updated on March 3, 2014


© 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