[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] coneprojection



PureBytes Links

Trading Reference Links

Hi,

I wonder if anyone has ever looked at coding a coneprojection. http://newsletter.neoticker.com/category/trading-general/ - and look for cone projection.

I have a code for another program which utilizes a stepping moving average as well as a stepping standard deviation. I have not found such a utility for AB and do not know how to program something like this. The cone projection lines are the dark blue and red lines.

Image

Any help would be appreciated. Here is the code I have so far:

TimeFrameSet(inDaily);

DailyHighPoints = H - O;
DailyLowPoints = O - L;
DailyMovingAvgH = MA(H, 90);
DailyMovingAvgL = MA(L, 90);

TimeFrameRestore();

HighToday =  TimeFrameGetPrice("H", inDaily, 0);
LowToday = TimeFrameGetPrice("L", inDaily, 0);
OpenToday = TimeFrameGetPrice("O", inDaily, 0);

DailyHighMAByStep = DailyMovingAvgH + DailyHighPoints;
DailyLowMAByStep = DailyMovingAvgL - DailyLowPoints;


Plot(OpenToday, "", colorRed, styleLine);
Plot (DailyHighMAByStep1,"", colorRed, styleLine);


DailyHighSDByStep = StDev(DailyHighPoints,90);
DailyLowSDByStep = StDev(DailyLowPoints,90);

DailyAvgHigh = OpenToday + DailyHighMAByStep;
DailyAvgLow = OpenToday - DailyLowMAByStep;

Plot(DailyAvgHigh, "", colorRed, styleLine);
Plot(DailyAvgLow, "", colorRed, styleLine);
Plot(DailyAvgHigh + DailyHighSDByStep, "", colorBlue, styleLine);
Plot(DailyAvgLow - DailyLowSDByStep, "", colorBlue, styleLine);

--------------------------------------------------------------------------------------------

The above code displays something very different than this code from Neoticker:

CompressSeries(DailySeries, Data1, ppDaily, 1);

DailyHighPoints := DailySeries.High - DailySeries.Open;
DailyLowPoints := DailySeries.Open - DailySeries.Low;

$DailyHighMAByStep := MovByStep(DailyHighPoints, "Day", "Simple", 90);
$DailyLowMAByStep := MovByStep(DailyLowPoints, "Day", "Simple", 90);

$DailyHighSDByStep := StdDevByStep(DailyHighPoints, "Day", 90);
$DailyLowSDByStep := StdDevByStep(DailyLowPoints, "Day", 90);

$DailyAvgHigh := DailySeries.Open + $DailyHighMAByStep;
$DailyAvgLow := DailySeries.Open - $DailyLowMAByStep;

Plot1 := $DailyAvgHigh;
Plot2 := $DailyAvgLow;  
Plot3 := $DailyAvgHigh + $DailyHighSDByStep;   
Plot4 := $DailyAvgLow - $DailyLowSDByStep;  

-----------------------------------------------------------------------------------------