Request: KAMA channels (std. dev.)

F

fuglaa

New member
Since the KAMA does such a good job at identifying flat markets perfect for mean reversion strategies, would anyone consider using it as the mid point on a channel?
I'm not sure whether a std. deviation or ATR channel would be more optimal. Thoughts?
 
T

tradebyday

Active member
I don't have KAMA, but here is one with I had made with HULL using ATR, you or someone else can splice KAMA into this code and add more ATR bands as you wish
Code:
input price = close;
input length = 200;
input displace = 0;
input multiplier = 1;
input ATRlength = 14;
input averageType = AverageType.WILDERS;

def ATR = MovingAverage(averageType, TrueRange(high, close, low), length);

def HMALine = MovingAverage(AverageType.HULL, price, length)[-displace];

plot upperband = HMALine + (multiplier * ATR);

plot HMA = HMALine;

plot lowerband = HMALine - (multiplier * ATR);

HMA.DefineColor("Up", GetColor(1));
HMA.DefineColor("Down", GetColor(0));
HMA.AssignValueColor(if HMA > HMA[1] then HMA.color("Up") else HMA.color("Down"));
 
F

fuglaa

New member
@tradebyday Thanks, I had trouble finding the KAMA code for movAvgAdaptive, figured out I had to hit "duplicate."
We'll have to see how it performs, but at first glance it looks really nice.



I added both Standard Deviation and ATR bands, std dev looks to be the most helpful insofar.
Here's the chart with the indicator,
https://tos.mx/0XzXfah
If you have any ideas on a novel strategy or system with it, please let me know. I think it's going to be most helpful in gauging market state, but I might test classic Bollinger bands strategies.
 
H

HBDL Trader

New member
@tradebyday : Thanks for sharing the code.

Is it possible to add custom alerts when the prices breaks the top/bottom?

I am looking to use it as a mean reversion scalp. Will fade the move only when it breaches the top or bottom line.

Looking to learn how to add alerts via thinkscript.

Coding is really not my thing which is why I am "retired" by the algos.

Thanks in advance.
 
T

tradebyday

Active member
@tradebyday : Thanks for sharing the code.

Is it possible to add custom alerts when the prices breaks the top/bottom?

I am looking to use it as a mean reversion scalp. Will fade the move only when it breaches the top or bottom line.

Looking to learn how to add alerts via thinkscript.

Coding is really not my thing which is why I am "retired" by the algos.

Thanks in advance.
Check some other thinkscripts in the forums, as I know several have alerts in them which you could simply copy pasta that portion of code then simply edit the text to match your required criteria. I don't use alerts for anything so it is not my particular expertise to add
 
H

HBDL Trader

New member
Check some other thinkscripts in the forums, as I know several have alerts in them which you could simply copy pasta that portion of code then simply edit the text to match your required criteria. I don't use alerts for anything so it is not my particular expertise to add

Thanks for the quick response. I will do that. Have a awesome day of trading:)
 

Similar threads

Top