this is 10 bar MA of close price, shifted 2 bars to the right, and moved up 1 dollar (or single price unit per Y scale)
Indicator = Ref( MA(C,10), -2), 1 ); -- Cheers Graham AB-Write >< Professional AFL Writing Service Yes, I write AFL code to your requirements http://www.aflwriting.com On 15/02/07, Wes Smith <[EMAIL PROTECTED]> wrote:
You want to read up on the param() and ref() function. It allows you to look at previous values in an array. For example blah = ref(Close,-2) ; // blah = the value of the close 2 bars ago. http://www.amibroker.com/guide/h_understandafl.html ----- Original Message ---- From: aleskresta <[EMAIL PROTECTED]> To: [email protected] Sent: Wednesday, February 14, 2007 6:42:00 AM Subject: [amibroker] Mooving average Hi there, I need help, I want to construct my own "indicator", it is simple mooving average, but I want two more parameters, on which it will depend. First is horizontal shift (I mean, if this parametrs will be 2, my computed MA will be shifted 2 days or other time periods to the past) and second will be vertical shifting(if this will be 2, my computed MA will be shifted 2 dolars(or other currency) up. I am just starting with AFL,so please could u help me and send me any comments how to do this. Thanks a lot Ales 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
