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

[amibroker] Unusual equity curve when I use scale in code



PureBytes Links

Trading Reference Links

Heres my code:  Cant figure out how the resulting
equity curve can look like that, Any suggestions?


// percent equity change threshold when pyramiding is
performed
PyramidThreshold = 15;
// regular trading rules (no pyramiding)
Buy = A AND BT AND D AND E AND result AND G AND F AND
K;   
Sell = sellresult OR I OR J;  

e = Equity(1); // generate equity without pyramiding
effect
PcntProfit = 100 * ( e - ValueWhen( Buy, e )
)/ValueWhen( Buy, e );
InTrade = Flip( Buy, Sell );
// ExRem is used here to ensure that scaling-in/out
occurs
// only once since trade entry
DoScaleIn = ExRem( InTrade AND PcntProfit >
PyramidThreshold, Sell );
DoScaleOut = ExRem( InTrade AND PcntProfit <
-PyramidThreshold, Sell );
// modify rules to handle pyramiding
Buy = Buy + sigScaleIn * DoScaleIn + sigScaleOut *
DoScaleOut;
PositionSize = IIf( DoScaleOut, -2, -5 ); // enter and
scale-in size




	
		
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

------------------------ Yahoo! Groups Sponsor --------------------~--> 
Try Online Currency Trading with GFT. Free 50K Demo. Trade 
24 Hours. Commission-Free. 
http://us.click.yahoo.com/RvFikB/9M2KAA/U1CZAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

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

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

PNG image