First, plotting arrows is a convenient part of the AmiBroker automatic analysis features.  Once you have run the backtester, simply right click on the data displayed and it will display trade arrows either for the actual signal day or the trade day if different.  The difference between trade and signal day is set on the trades tab in the automatic analysis window.  You can also use the plotting features of the program to plot arrows without using the backtester.  However with what you are suggesting here, it would be a good idea to test before using to understand the reward and risk potential of what you suggest.

 

The remainder of the code you want is relatively simple, but most here will not provide you help with code until you have read the help and tutorials and made at least an attempt at writing the code for yourself.

 

But here’s a start.

 

UpRevA = L < ref(L,-1);

UpRevB= C > ref(C,-1) or C > ref(H,-1);

 

Buy=UpRev1 and UpRev2;

 

You can combine it all into a single buy statement with an included iff as we, but sometimes it’s easier to keep the parts separate till it’s running.

If you are going to use an if statement, remember that AmiBroker uses two ii’s in the iif statement.

 

Buy = iif(L < ref(L,-1) and (C > ref(C,-1) or C > ref(H,-1),1,0);

 

The help and tutorials are really very good.

 

Best of Luck.

 

Mike

 


From: amibroker@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of sesamys
Sent: Tuesday, October 24, 2006 7:23 PM
To: amibroker@yahoogroups.com
Subject: [amibroker] Coding help.

 

Gentelmen,
I need your help to transform this idea into AFL code.
Thanks in anticipation.
The idea is to plot an arrow above (or under) the bar indicating a
reversal day as per the belowmentioned:
1- Upside Reversal:
If Day n low < Day n-1 low.
AND Day n close > Day n-1 close or Day n-1 high.
2- Downside Reversal:
If Day n high > Day n-1 high.
AND Day n close < Day n-1 close or Day n-1 low.
3- Upside key reversal day.
IF Day n close < Day n-1 low.
AND Day n+1 close > Day n close and day n-1 close.
4- Downside key reversal day.
IF Day n close > Day n-1 close.
AND Day n+1 close < Day n close and day n-1 close.
Your help is highly appreciated.
Best regards.

__._,_.___

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





SPONSORED LINKS
Investment management software Investment property software Investment software
Investment tracking software Return on investment software

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___

Reply via email to