Thanks for clearing that up, Mike!

CBT documentation is pretty vague sometimes, imho.

Markus
  ----- Original Message ----- 
  From: Mike 
  To: [email protected] 
  Sent: Sunday, November 08, 2009 7:34 AM
  Subject: [amibroker] Re: Custm backtester - calling methods and properties


    
  You can call object methods anytime you have a valid object. The question is, 
where did the trade object come from?

  It is perfectly valid, for example, to do something like:

  trade = bo.GetFistTrade();

  for (sig = bo.GetFirstSignal(i);sig; sig = GetNextSignal(i)) {
  ...
  if (trade.GetPositionvalue() >= 50000)
  sig.PosSize=0;
  ...
  }

  --- In [email protected], "Markus Witzler" <funny...@...> wrote:
  >
  > Hello again,
  > 
  > I have always been under the impression that trade properties/methods can 
only be called within a trade loop and signal properties/methods can only be 
called in a signal loop.
  > 
  > But in the documentation in the "users knowledge base", I found this:
  > 
  > for (sig = bo.GetFirstSignal(i);sig; sig = GetNextSignal(i))
  > ...
  > if (trade.GetPositionvalue() >= 50000)
  > sig.PosSize=0;
  > ...
  > 
  > Wouldn´t one need a trade loop to be able to call GetPosiotionValue which 
is a trade method, or can methods/properties be called from any kind of loop 
(trade or signal)?
  > 
  > Thanks
  > 
  > Markus
  > 
  > 
  > 
  > __________ Information from ESET Smart Security, version of virus signature 
database 4581 (20091107) __________
  > 
  > The message was checked by ESET Smart Security.
  > 
  > http://www.eset.com
  >



  

  __________ Information from ESET Smart Security, version of virus signature 
database 4583 (20091108) __________

  The message was checked by ESET Smart Security.

  http://www.eset.com




__________ Information from ESET Smart Security, version of virus signature 
database 4583 (20091108) __________

The message was checked by ESET Smart Security.

http://www.eset.com

Reply via email to