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

Re: [amibroker] Re: Enter position once?



PureBytes Links

Trading Reference Links

Hello,
 
This code does not pyramid trades.
If it did you would see that in the last column of backtest result list - it would list Scale In/Scale Out different than 0/0

Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message -----
From: csvirtual
Sent: Saturday, May 06, 2006 2:19 PM
Subject: [amibroker] Re: Enter position once?

Hello Tomasz,

my code:

SetPositionSize( 100, spsPercentOfEquity );

SetTradeDelays(1,1,1,1);

//SetOption("initialequity",25000);

bdelay = Status("buydelay");

sdelay = Status("sdelay");

period1=28;// Optimize("MFI Period",28,15,45,1);

period2=100;//Optimize("ATR Period",100,10,200,2);

period3=34;//Optimize("MA Period",34,10,60,1);

period4=25;//Optimize("BBand Period", 25,15,50,1);

width=1.5;//Optimize("BBand Width",1.5,1,2.5,0.1);



indi=MFI(period1)-ATR(period2); //my indicator



indientry = ValueWhen(Cross(Close,BBandTop(Close,period4,width)) AND
indi<Ref(indi,-1),indi);

Buy = Cross(Close,BBandTop(C,period4,width)) AND indi<Ref(indi,-1);

Sell = Cross(MA(Close,period3),Close); //Cross(indi,indientry) OR

Plot (C,"",ParamColor("Price Color",colorBlack),styleCandle);

Plot(MA(Close, period3),"MA", colorOrange, styleLine);

Plot(BBandTop(C,period4,width),"BB Top", colorBlue, styleLine);

Plot(BBandBot(C,period4,width),"BB Bottom", colorBlue, styleLine);

PlotShapes(shapeUpArrow*Buy,colorGreen,0,L);

//PlotShapes(shapeDownArrow*Short, colorRed,0,H);

PlotShapes(shapeSmallSquare*Sell, colorGreen,0,H);

//PlotShapes(shapeSmallSquare*Cover, colorRed,0,L);

//Graph0=Equity(1);

//Graph0Style=1;



I can't figure out where I do pyramiding?

cheers,

Christian






--- In amibroker@xxxxxxxxxxxxxxx, "Tomasz Janeczko" <amibroker@xxx> wrote:
>
> Hello,
>
> It will open just one position per symbol BY DEFAULT (if you use 1
or True in buy array).
>
> If it is pyramiding it means that you told it to do so by specifying
sigScaleIn in buy array.
>
> Best regards,
> Tomasz Janeczko
> amibroker.com
>   ----- Original Message -----
>   From: csvirtual
>   To: amibroker@xxxxxxxxxxxxxxx
>   Sent: Saturday, May 06, 2006 3:17 AM
>   Subject: [amibroker] Enter position once?
>
>
>   Hello,
>
>   my problem with backtesting is that a trade is entered when the signal
>   is given although an earlier signal provided the entry! So it is
>   pyramiding.
>
>   I just want to enter with 100% of equity and first after a sell go
>   long again, not during an open trade. How can I code this?
>   I use SetPositionSize( 100, spsPercentOfEquity ) and
>   SetOption("initialequity",25000)
>
>   Any help appreciated
>
>   thanks
>
>
>
>
>
>
>   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
>
>
>
>
>
>   SPONSORED LINKS Investment management software  Real estate
investment software  Investment property software 
>         Software support  Real estate investment analysis software
Investment software 
>
>
>
------------------------------------------------------------------------------
>   YAHOO! GROUPS LINKS
>
>     a..  Visit your group "amibroker" on the web.
>      
>     b..  To unsubscribe from this group, send an email to:
>      amibroker-unsubscribe@xxxxxxxxxxxxxxx
>      
>     c..  Your use of Yahoo! Groups is subject to the Yahoo! Terms of
Service.
>
>
>
------------------------------------------------------------------------------
>






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





SPONSORED LINKS
Investment management software Real estate investment software Investment property software
Software support Real estate investment analysis software Investment software


YAHOO! GROUPS LINKS