>From User's Guide:

http://www.amibroker.com/guide/a_custombacktest.html

a.. bool IsLong

True if trade is long, False otherwise

So inside your custom backtester code write:


if( trade.IsLong ) ....

Best regards,
Tomasz Janeczko
amibroker.com
  ----- Original Message ----- 
  From: Trinolix Derry 
  To: amibroker@yahoogroups.com 
  Sent: Saturday, June 02, 2007 6:56 PM
  Subject: [amibroker] CBI: Getting Trade direction (bool IsLong)


  Hello,

  I need to access the trade direction inside my CBI code or in other words i 
want to know if trade.GetProfit comes from a long or short trades and depending 
on the direction i want to make different R-Multiple calculations. My 
calculation should look like 

  if ( IsLong )
  {
  RMultiple = trade.GetProfit() / Long_InitialRiskAtEntry; 
  }
  else 
       RMultiple = trade.GetProfit() / Short_InitialRiskAtEntry;

  Can someone tell me how to do it ?
  Thanks in advance !

  Regards
  Trinolix 

   

Reply via email to