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

[amibroker] Pyramiding: position not closed after sigScaleOut resulting in zero shares


  • To: amibroker@xxxxxxxxxxxxxxx
  • Subject: [amibroker] Pyramiding: position not closed after sigScaleOut resulting in zero shares
  • From: "markhoff" <markhoff@xxxxxx>
  • Date: Sun, 24 Jun 2007 02:00:50 -0000

PureBytes Links

Trading Reference Links

Hello,

I noticed one other thing when using the sigScaleOut for pyramiding
which is not clear to me why AB behaves in this way.

If I have an open position of shares (long), and my position is
reduced to zero shares due to a "buy = sigScaleOut", then the
backtester does not close the position. Instead, the trade list the
symbol ist still reported as "open long" with "shares = 0". I must
initiate an explicit sell signal to close the position. This can be
reproduced with the following code:

//--- cut here ---

SetOption("InitialEquity",10000);
SetOption("MaxOpenPositions",5);
PositionSize = 5000 ;

Sell = 0;

BarInRange = Status("barinrange");
FirstPurchase = Cum(1 AND BarInRange) == 1;

// buy on first day and decrease position in the following days
// until everything is sold
Buy = IIf( FirstPurchase, True, sigScaleOut);

Filter = 1 ;

AddColumn( FirstPurchase, "FirstPurchase", 1.0);

//--- cut here ---

If above code is used in backtester, the open positions will not be
closed after all shares have sold.  Since AB considers a first
"Buy=sigScaleOut" as "Buy=True" to open a position automatically I
think it would be more straight forward if the position is also
automatically closed.
Any idea why AB does it this way and keeps open positions?

Thanks in advance and best regards,
Markus




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

<*> 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/