Canada
Posts: 12 since Feb 2011
|
I have some code below for TS which utilizes a displaced slowMA. How would I replace this displaced slowMA with a displaced low band of a keltner channel? This one is taxing my brain!!
Thanks
Pi
inputs:
Extension1_Percent(200),
Extension2_Percent(250),
ExtensionColor(red),
ExtensionColorMove(darkre d),
ShowExtensionHistory(true ),
LineLength_Bars(4),
SlowAvgPrice(close),
SlowAvgLength(10),
SlowAvgDisplace(3),
FastAvgPrice(close),
FastAvgLength(5);
variables:
Debug(false),
StartSwitch(false),
SecondSwitch(false),
ThirdSwitch(false),
OriginalLow(0),
Counter(0),
Projection1(0),
Projection2(0),
SlowAverage(0),
FastAverage(0),
TLForeCast(0),
LowBar(99999999),
TL(-1);
//========================= =========
// Calcluation Module
//========================= =========
Once TL = TL_New(Date,Time,0,Date,T ime,0); //Initialized TrendLine
SlowAverage = WAverage(SlowAvgPrice, SlowAvgLength);
FastAverage = WAverage(FastAvgPrice, FastAvgLength);
Counter += 1;
if date <> date[1] then begin //reset conditions on start of day
StartSwitch = false;
SecondSwitch = false;
ThirdSwitch = false;
end;
if SlowAvgDisplace >= 0 or CurrentBar > AbsValue(SlowAvgDisplace) then begin
|