♥ 0 |
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
|
♥ 0 |
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
|
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?
Thanks!
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 MINlength = 14;
input MINover_bought = 70;
input MINover_sold = 40;
input MINrsiAverageType = AverageType.WILDERS;
input MIN5price = close;
input MIN5length = 70;
input MIN5over_bought = 70;
input MIN5over_sold = 40;
input MIN5rsiAverageType = AverageType.WILDERS;
input MINfastLength = 12;
input MINslowLength = 26;
input MINmacdLength = 9;
input MINaverageType = AverageType.EXPONENTIAL;
input MIN5fastLength = 60;
input MIN5slowLength = 130;
input MIN5macdLength = 45;
input MIN5averageType = AverageType.EXPONENTIAL;
input HOURfastLength = 720;
input HOURslowLength = 1560;
input HOURmacdLength = 540;
input HOURaverageType = AverageType.EXPONENTIAL;
def MINrsi = reference RSI(price = MINprice, length = MINlength, averageType = MINrsiAverageType);
def MIN5rsi = reference RSI(price = MIN5price, length = MIN5length, averageType = MIN5rsiAverageType);
def MINdiff = reference MACD(MINfastLength, MINslowLength, MINmacdLength, MINaverageType).Diff;
def MIN5diff = reference MACD(MIN5fastLength, MIN5slowLength, MIN5macdLength, MIN5averageType).Diff;
def HOURdiff = reference MACD(HOURfastLength, HOURslowLength, HOURmacdLength, HOURaverageType).Diff;
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.
Nevermind, I got it!
input fastLength = 12;
input slowLength = 26;
input MACDLength = 9;
input averageType = AverageType.EXPONENTIAL;
def Min5Value = MovingAverage(averageType, close(period = AggregationPeriod.FIVE_MIN), fastLength) – MovingAverage(averageType, close(period = AggregationPeriod.FIVE_MIN), slowLength);
def Min5Avg = MovingAverage(averageType, Min5Value, MACDLength);
AddOrder(OrderType.BUY_AUTO, Min5Value – Min5Avg > 0;
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…