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

[amibroker] Re: MACD Predictor



PureBytes Links

Trading Reference Links

This is to add to Ara's remarks:
AB views requests for data from the future as 'missing data'.  So it
will fill in the 'missing' value with the last valid value - it uses
today's OHLC values for tomorrow's prices.

When you roll forward one day the previous last value for the
indicator will change to reflect the value now available.  This could
mean that what was a signal yesterday is now not a signal.

The dangerous thing about using future data is that during
backtesting, values from the future ARE AVAILABLE.  This means that as
the system moves through previous data, it picks tomorrows values,
since they are available in the data set.

This can produce incorrectly positive results from the backtest.

You can check for future references when you are creating your *.afl
by using the 'Check' function in the 'Tools' drop-down in the Editor.

Ed Hoopes





--- In amibroker@xxxxxxxxxxxxxxx, "Ara Kaloustian" <ara1@xxx> wrote:
>
> George,
> 
> Your code is asking AB to retreive a value (from the future) that
does not 
> exist yet.
> 
> To find the value of price that will cause a particular event you
need to do 
> some math to compute the value.
> 
> The math in this case would require the equations for the 2 moving
averages 
> to be equal, (with the last closing price as an unknown) which gives
you 2 
> equations to solve simuoulateously ... and beleive would end up as a 
> quadratic equation.
> 
> 
> 
> 
> ----- Original Message ----- 
> From: "slamming26_11" <george.rayzis@xxx>
> To: <amibroker@xxxxxxxxxxxxxxx>
> Sent: Monday, June 18, 2007 6:10 PM
> Subject: [amibroker] MACD Predictor
> 
> 
> > r1 = Param( "Fast avg", 12, 2, 200, 1 );
> > r2 = Param( "Slow avg", 26, 2, 200, 1 );
> > r3 = Param( "Signal avg", 9, 2, 200, 1 );
> > mm = MACD(r1, r2);
> > ms = Signal(r1, r2, r3);
> > UpCrossover = Cross( mm, ms );
> > DownCrossover = Cross( ms, mm);
> > IIf( mm > ms, DownCrossover, UpCrossover );
> > ValueWhen( DownCrossover, Ref(C,1));
> > ValueWhen( UpCrossover, Ref(C,1));
> > MACDPredictor = ValueWhen( DownCrossover, Ref(C, 1)) OR
> > ValueWhen( UpCrossover, Ref(C,1));
> > Plot(MACDPredictor,"",4);
> >
> > The above code is a my feeble attempt to show the very next future
> > closing price that would create a crossover of the mm and ms. Please
> > help as I am not experienced with AFL coding.
> >
> > Thanks.
> >
> > George
> >
> >
> >
> > Please note that this group is for discussion between users only.
> >
> > To get support from AmiBroker please send an e-mail directly to
> > SUPPORT {at} amibroker.com
> >
> > For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
> > http://www.amibroker.com/devlog/
> >
> > For other support material please check also:
> > http://www.amibroker.com/support.html
> >
> > Yahoo! Groups Links
> >
> >
> >
>




Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html
 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/