Skip to main content

Price Predict for Amibroker (AFL)

joewang12 almost 13 years ago Amibroker (AFL)

  • Rating:
    4 / 5 (Votes 5)
  • Tags:
    amibroker

To predict tomorrow’s price based on velocity change.

Indicator / Formula

Copy & Paste Friendly
_SECTION_BEGIN("PrePrice");
// Joewang Predict price
//PrePrice=Ref(C,-1)+(Ref(C,-1)-Ref(C,-4)-Ref(C,-7)+Ref(C,-10))/6;

Price=Close
+(Close-Ref(Close,-1)-Ref(Close,-2)+Ref(Close,-3))/6
+(Ref(Close,-1)-Ref(Close,-2)-Ref(Close,-3)+Ref(Close,-4))/6
+(Ref(Close,-2)-Ref(Close,-3)-Ref(Close,-4)+Ref(Close,-5))/6
+(Ref(Close,-3)-Ref(Close,-4)-Ref(Close,-5)+Ref(Close,-6))/6
+(Ref(Close,-4)-Ref(Close,-5)-Ref(Close,-6)+Ref(Close,-7))/6;

xPrice=Ref(Price,-1);

Price=MA(Price,3);
xPrice=MA(xPrice,3);

Plot(Price,"Price",ParamColor("Price",colorcycle),styleLine);
Plot(xPrice,"xPrice",ParamColor("xPrice",colorcycle),styleLine|styleThick);

Plot(C,"Close",ParamColor("Candle",colorcycle),styleCandle);
_SECTION_END();

8 comments

almost 13 years ago

To; jowwang12
good indicator
could you add buy & sell arrows at crossoveers
thanks
Dan – Member Wisestocktrader

almost 13 years ago

@ dustyreagan

You could paste the following code at the end of the formula:

Buy= Cross(price,xprice);
Sell=Cross(xprice,price);

shape = Buy * shapeUpArrow + Sell * shapeDownArrow;

PlotShapes( shape, IIf( Buy, colorGreen, colorRed ), 0, IIf( Buy, Low, High ) );
over 12 years ago

Dear rumibepari
Should be working in ver. 5.50 . Could you please post the error message perhaps it can be helped.

over 12 years ago

This is the exact code that works fine for me in ver 5.50

_SECTION_BEGIN("PrePrice");
// Joewang Predict price
//PrePrice=Ref(C,-1)+(Ref(C,-1)-Ref(C,-4)-Ref(C,-7)+Ref(C,-10))/6;
 
Price=Close
+(Close-Ref(Close,-1)-Ref(Close,-2)+Ref(Close,-3))/6
+(Ref(Close,-1)-Ref(Close,-2)-Ref(Close,-3)+Ref(Close,-4))/6
+(Ref(Close,-2)-Ref(Close,-3)-Ref(Close,-4)+Ref(Close,-5))/6
+(Ref(Close,-3)-Ref(Close,-4)-Ref(Close,-5)+Ref(Close,-6))/6
+(Ref(Close,-4)-Ref(Close,-5)-Ref(Close,-6)+Ref(Close,-7))/6;
 
xPrice=Ref(Price,-1);
 
Price=MA(Price,3);
xPrice=MA(xPrice,3);
 
Plot(Price,"Price",ParamColor("Price",colorcycle),styleLine);
Plot(xPrice,"xPrice",ParamColor("xPrice",colorcycle),styleLine|styleThick);
 
Plot(C,"Close",ParamColor("Candle",colorcycle),styleCandle);
_SECTION_END();


Buy= Cross(price,xprice);
Sell=Cross(xprice,price);

shape = Buy * shapeUpArrow + Sell * shapeDownArrow;

PlotShapes( shape, IIf( Buy, colorGreen, colorRed ), 0, IIf( Buy, Low, High ) );

Leave Comment

Please login here to leave a comment.