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

[amibroker] Vertical Green and Red Lines on Chart Pane



PureBytes Links

Trading Reference Links

Have you folks noticed if you double click an area of a price chart
you get a green vertical line? And then if you move to the right and
double click again you get a red vertical line?
I searched the help files and found nothing describing the function of
these lines. I would like to use them to calculate my P/L on entry and
exits. Double click on entry bar, double click on exit bar and then
use some AFL code to display the % P/L. It could display in the
iterpretation window or print the value directly to the chart.
Here's what I've been experimenting with:
///////////////Code///////////////
Entry = ValueWhen(Study("EN", 1473)==0, O);
printf("Entry: " + Entry + "\n");
Exit = ValueWhen(Study("EX", 1473)==0, O);
printf("Exit = " + Exit +"\n");

NetPL = (((Exit + 0.0001) - Entry)/ Entry)*100;
printf("Net P/L = " + NetPL +"\n");
//////////////Code/////////////////

The problem is you have to add a two studies (vertical lines) and name
the entry line 'EN' and the exit line 'EX'. There is a problem with
this code in that if you draw or move the 'EX' study line to the final
bar on the right it generates a zero value. Another bug in this code
is somewhat related. The active or selected bar on the chart must be
at least one bar to the right of the 'EX' study line.

Hope someone has a better way of doing this.
Thanks for any feedback.

  Pete  :-)


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

**** IMPORTANT ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

*********************
TO GET TECHNICAL 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/