|
发表于 2013-5-1 02:04 AM
|
显示全部楼层
abracadabra 发表于 2013-4-7 03:50 AM
Jeff Augen 本人有code,也有人针对ThinkorSwim写了code,这里不便提供其他网站链接,直接粘贴过来吧,供 ...
Haha, change your head again.
Thanks for sharing Augen indicator code. After adding a few codes for two new colors I feel it may looks better. Try it and hope it may be helpful.
declare lower;
input length = 20;
def closeLog = log(close[1] / close[2]);
def SDev = stdev(closeLog, length) * Sqrt(length / (length – 1));
def m = SDev * close[1];
def spike = (close[0] – close[1]) / m;
plot spike_limit = if spike > 3 then 3 else if spike < -3 then -3 else
spike;
spike_limit.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
spike_limit.AssignValueColor(if spike > 3.0 then Color.GREEN else if spike > 2 then color.LIGHT_ORANGE else if spike >
0 then CreateColor(0,102,255) else if spike < -3 then Color.RED else if spike < -2 then color.MAGENTA else if
spike < 0 then CreateColor(128,128,128) else Color.YELLOW);
plot high = 2;
high.SetDefaultColor(CreateColor(51,51,51));
plot low = -2;
low.SetDefaultColor(CreateColor(51,51,51));
|
-
|