Creating Indicator (Study) for TOS (Thinkorswim platform).
Indicator name: Hull Moving Average MTF.
TOS has default Hull MA, but it is limited. I need additional features:
1. MTF - multi time frame (ability to display indicator on a smaller time frame based on the data of higher time frame)
2. Calculation in Hull MA are based on one the subtraction of two weighted averages where period of the second is X time smaller than the period of the first one. By default X = 2. I need this to be converted into Variable, that I can edit from indicator properties menu
3. Average has to have UP/DOWN paint feature
4. Final code should be working per description provided in the post and tested successfully within TOS. It should be saved in .ts file unlocked for further editing. It may not be copyrighted by 3d party and to be considered a property of the project poster.
input TimeFrame = "Current time frame";
input HMAPeriod = 35;
input HMAPrice = PRICE_CLOSE;
input HMASpeed X = 2.0;
input displace = 0
HMAPeriod = MathMax(HMAPeriod);
HalfPeriod = MathFloor(HMAPeriod/HMASpeed);
HullPeriod = MathFloor(MathSqrt(HMAPeriod));