I have been working with the “Thinkorswim AutoTrade Almost” video and was wondering how the aggration is managed, ie daily, Hourly, 30 minute and so on.
Marked as spam
Screenshot below shows how to set the aggregation period when entering a conditional order.
Marked as spam
I’d like to expand on the original question a bit. How can you, in the thinkScript Editor assign a secondary aggregate period to a study such as MACD? For example, if my primary aggregate period is 1 Min how do I set an order trigger when the 5 Min MACD and 1 Hour MACD conditions are met?
To reference the 5 min close from a 1 min aggregation period use this: def fiveMinClose = close(period = AggregationPeriod.FIVE_MIN);
From what you have described so far, your full request is going to be far more complex than what we provide at no charge in the Q&A forum. So if you need someone to write the entire code for you I suggest you consider submitting a custom project request here: https://www.hahn-tech.com/about/
Thanks for the reply so soon! I think I found a workaround but i’ll give your method a try too.
input MINprice = close;
input MIN5price = close;
input MINfastLength = 12;
input MIN5fastLength = 60;
input HOURfastLength = 720;
def MINrsi = reference RSI(price = MINprice, length = MINlength, averageType = MINrsiAverageType);
I need to test this strategy deeper to see how it performs. Thank you for your vids on creating strategies by the way. They are so powerful.
My method doesn’t quite work…Using your method, where do I apply the new definition to the MACD? input fastLength = 12; input slowLength = 26; input macdLength = 9; input averageType = AverageType.EXPONENTIAL; def fiveMinClose = close(period = AggregationPeriod.FIVE_MIN); def diff = reference MACD(fastLength, slowLength, macdLength, averageType).Diff; AddOrder(OrderType.BUY_AUTO, diff crosses above 0, tickcolor = GetColor(0), arrowcolor = GetColor(0)); AddOrder(OrderType.SELL_AUTO, diff crosses below 0, tickcolor = GetColor(1), arrowcolor = GetColor(1));
Nevermind, I got it!
input fastLength = 12;
Great, glad you worked it out. If you want to see an example, be sure to check out this video: https://www.hahn-tech.com/thinkorswim-mtf-macd-indicator/
THAT’S AMAZING!!! Exactly what I was trying to achieve. So much headache for something that already exists…
Please log in to post questions.