PureBytes Links
Trading Reference Links
|
You have Buy = 1;
This gives a Buy signal on EVERY BAR of the database.
Then you have the last param of ApplyStop set to 0, which means 0 days
before entering a new position.
Try a more restrictive Buy and/or using some number of days before a
re-entry is allowed.
--
Terry
-----Original Message-----
From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On
Behalf Of baszanowski
Sent: Friday, October 07, 2005 10:07
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] TrailStop: ApplyStop opens positions for me?
Hello,
I am learnig the AmiBroker Folmula Language. For the test puroses I
wrote a simple backtester system. I want it to open one long
position at bar 1 and apply a trailing stop to it. That's it: I
don't want any more positions open. I just want to test what will be
the behaviour of the trailing stop applied to this single position.
However, the code that I came up with seems to open new long
positions everytime the stoploss order has been executed on the
previously opened position.
Can anyone advise as to what is wrong with my code? I past my code
below
Thanks,
WB
- - - - code start - - - - -
PositionSize = 100000; // The size of 1 lot
TickSize = 0.0001;
for( i = 1; i < BarCount; i++ )
{
if (i == 1)
{
Buy = 1;
ApplyStop(2, 2, 0.0050, 1, False, 0);
}
else
{
Sell = 0;
Short = 0;
Cover = 0;
}
}
- - - - code end - - - - -
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
------------------------ 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/
|