Multiple Timeframe for MACD - ThinkOrSwim Programming | futures io social day trading
futures io futures trading


Multiple Timeframe for MACD
Updated: Views / Replies:1,507 / 3
Created: by gcorrea Attachments:1

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
 
Thread Tools Search this Thread
 

Multiple Timeframe for MACD

  #1 (permalink)
Trading Apprentice
Puerto Rico
 
Futures Experience: Intermediate
Platform: TOS/NinjaTrader
Favorite Futures: Futures, Gold, and Stocks
 
Posts: 1 since Jan 2014
Thanks: 1 given, 0 received

Multiple Timeframe for MACD

Hi, This is the first time I participate in your forum (and to be honest a newby on TOS ThinkScripts Programming).

I want to add a thinkscript code for a Multiple Time Frame for MACD. My main chart is 5 minutes and wanted to have MACD for 15 and 60 minute on my 5 minutes chart.

So far, this is what my 5 min TOS Chart currently has:

input averagefastLength = 9;
input averageslowLength = 27;
input macdLength = 7;
input averageType = {SMA, default EMA};

def diff = reference MACD(averagefastLength, averageslowLength, macdLength, averageType).Diff;
def exit = EntryPrice();


Your help on this type of aggregation will be very appreciated.

Thanks

Reply With Quote
 
  #2 (permalink)
1.Fibs 2.??? 3.Profit
Puerto Rico
 
Futures Experience: Intermediate
Platform: thinkorswim
Broker/Data: TD Ameritrade
Favorite Futures: ES
 
rmejia's Avatar
 
Posts: 384 since Oct 2010
Thanks: 3,597 given, 421 received

Gave it a shot; it gets a bit fugly the higher the timeframe. The lines in bold were added/edited from the default MACD.
 
Code
declare lower;

input fastLength = 12;
input slowLength = 26;
input MACDLength = 9;
input averageType = AverageType.EXPONENTIAL;
input TimeFrame = AggregationPeriod.Day;

plot Value = MovingAverage(averageType, close(period = TimeFrame), fastLength) - MovingAverage(averageType, close(period = TimeFrame), slowLength);
plot Avg = MovingAverage(averageType, Value, MACDLength);

plot Diff = Value - Avg;
plot ZeroLine = 0;

Value.SetDefaultColor(GetColor(1));
Avg.SetDefaultColor(GetColor(8));
Diff.SetDefaultColor(GetColor(5));
Diff.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
Diff.SetLineWeight(3);
Diff.DefineColor("Positive and Up", Color.GREEN);
Diff.DefineColor("Positive and Down", Color.DARK_GREEN);
Diff.DefineColor("Negative and Down", Color.RED);
Diff.DefineColor("Negative and Up", Color.DARK_RED);
Diff.AssignValueColor(if Diff >= 0 then if Diff > Diff[1] then Diff.color("Positive and Up") else Diff.color("Positive and Down") else if Diff < Diff[1] then Diff.color("Negative and Down") else Diff.color("Negative and Up"));
ZeroLine.SetDefaultColor(GetColor(0));

https://tlc.thinkorswim.com/center/charting/thinkscript/tutorials/Chapter-12---Referencing-Secondary-Aggregation.html

https://tlc.thinkorswim.com/center/charting/thinkscript/reference/Constants/AggregationPeriod.html

Attached Files
Register to download File Type: ts _MACDmultipletimeframesSTUDY.ts (1.1 KB, 34 views)
Reply With Quote
The following user says Thank You to rmejia for this post:
 
  #3 (permalink)
Membership Temporarily Revoked
Vidor, TX/USA
 
Futures Experience: Intermediate
Platform: MT4 and TOS
Favorite Futures: Forex
 
LorraineP's Avatar
 
Posts: 15 since Jan 2015
Thanks: 5 given, 6 received


I've used TOS. And I've used MacD and several variations of it on TOS. I believe it automatically changes when you change your time frame.

So I don't get why you are trying to recreate the wheel?

Reply With Quote
 
  #4 (permalink)
1.Fibs 2.??? 3.Profit
Puerto Rico
 
Futures Experience: Intermediate
Platform: thinkorswim
Broker/Data: TD Ameritrade
Favorite Futures: ES
 
rmejia's Avatar
 
Posts: 384 since Oct 2010
Thanks: 3,597 given, 421 received


LorraineP View Post
I've used TOS. And I've used MacD and several variations of it on TOS. I believe it automatically changes when you change your time frame.

So I don't get why you are trying to recreate the wheel?

He wants to be able to have a different timeframe on the MACD from the chart:


gcorrea View Post
My main chart is 5 minutes and wanted to have MACD for 15 and 60 minute on my 5 minutes chart.


Reply With Quote

Reply



futures io > > > > > Multiple Timeframe for MACD

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Linda Bradford Raschke: Reading The Tape

Elite only

Adam Grimes: TBA

Elite only

NinjaTrader: TBA

January

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple MACD in EL Saraf64 TradeStation 4 March 19th, 2014 07:13 PM
NT multiple timeframe dimpledbrain NinjaTrader 4 February 19th, 2014 04:46 PM
How to Reference MACD-1 and MACD-2 in the Same Chart a2trader EasyLanguage Programming 3 July 21st, 2013 06:11 PM
Trendlines not matching from Higher Timeframe to lower Timeframe? bluemele NinjaTrader 26 October 8th, 2012 03:35 PM
sensitivity multi-timeframe trick (small timeframe on bigger one) SARdynamite NinjaTrader Programming 4 July 15th, 2010 03:57 PM


All times are GMT -4. The time now is 02:21 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-12 in 0.09 seconds with 20 queries on phoenix via your IP 54.163.209.109