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

[amibroker] Can you identify this formula?



PureBytes Links

Trading Reference Links

Hermann,

if I understand you, the applystops are not executed with minutes 
Bars.
Hum? I don't like applystop except for backtesting futures ( the 
amount of stops in point is easy to write).

I copy a winning system on the S&P ( winning on the paper,and 
backtest from 02/01 to 09/03), and the applystop are executed 
correctly. I don't trade the S&P future.

the settings are 
commission: 5/contracts
future mode : check
active stop immediately:check
allow same bar exit:check

stephane




//Title="AAZ long Applystop";

Tradezone = (TimeNum() >= 200500 AND TimeNum() < 214000);
Horaire = (TimeNum() >= 163000 AND TimeNum() < 200500);
PicHoraire= Hold(Horaire==0,2) AND Horaire;
Hiday= HHV(H,BarsSince(pichoraire)); 
LoDay= LLV(L,BarsSince(pichoraire)); 

Hiday= HHV(H,BarsSince(pichoraire)); 
LoDay= LLV(L,BarsSince(pichoraire));

Buystop=Ref(Hiday + 1.5,-1);
Plot(Buystop,"",colorGreen,1);
Sellstop=Ref(LoDay - 1.5,-1);
Plot(Sellstop,"",colorGreen,1);

Buy = H>=Buystop AND Tradezone;
Buy=Hold(Buy==0,2) AND Buy AND Tradezone ;

Stoploss= 16 ;
Trailstop=  32 ; //O-63;
Target= 20;

Sell= TimeNum() >220500;
BuyPrice=Buystop;

ApplyStop (stopTypeProfit, stopModePoint, 
Target ,exitatstop=True,volatile=False,ReEntryDelay=1) ;
ApplyStop (stopTypeLoss, stopModePoint, StopLoss, 
exitatstop=True,volatile=False,ReEntryDelay=1) ; 
ApplyStop (stopTypeTrailing, stopModePoint, Trailstop, 
exitatstop=True,volatile=False,reentrydelay=1) ;

/* le mode de calcul du trailing est # de Rem.dll il est fonction de 
highest H - valuewhen(Buy,value point)*/ 

Equity(1,0);

Plot(Close,"close",IIf( Buy, colorGreen, IIf(Sell , 
colorRed ,1 )),64);
Plot(ValueWhen(Buy,BuyPrice),"BuyPrice",colorWhite,1);
Plot(ValueWhen(Sell,SellPrice),"SellPrice",colorYellow,1);
PlotShapes(IIf(Buy,
shapeUpArrow,shapeNone),colorGreen,0,C,-20); 
PlotShapes(IIf(Sell,
shapeDownArrow,shapeNone),colorRed,0,H,-20);

Plot(ValueWhen(Buy,BuyPrice-StopLoss),"StopLoss",colorRed,1);
Plot(HighestSince(Buy, H - ValueWhen
(Buy,TrailStop)),"Trailing",colorGreen,1);
Plot(ValueWhen(Buy,BuyPrice+Target),"Target",colorBlue,1);

GraphXSpace=1;

Title="AAZ short Applystop";

Sellstop=Ref(LoDay - 1.5,-1); 
Plot(Sellstop,"",colorGreen,1);

Short = L<=Sellstop AND Tradezone;
Short=Hold(Short==0,2) AND Short AND Tradezone ;

Stoploss= 16 ;
Trailstop=  32 ; //O-63;
Target= 20;

Cover= TimeNum() >220500;
ShortPrice=SellStop;

ApplyStop (stopTypeProfit, stopModePoint, 
Target ,exitatstop=True,volatile=False,ReEntryDelay=1) ;
ApplyStop (stopTypeLoss, stopModePoint, StopLoss, 
exitatstop=True,volatile=False,ReEntryDelay=1) ;
ApplyStop (stopTypeTrailing, stopModePoint, Trailstop, 
exitatstop=True,volatile=False,reentrydelay=1) ;

Equity(1,0);

Plot(Close,"Close",IIf( Short, colorGreen, IIf(Cover , 
colorRed ,1 )),64);
Plot(ValueWhen(Short,ShortPrice),"ShortPrice",colorWhite,1);
Plot(ValueWhen(Cover,CoverPrice),"CoverPrice",colorYellow,1);
PlotShapes(IIf(Short,
shapeDownArrow,shapeNone),colorBlue,0,C,-10); 
PlotShapes(IIf(Cover,
shapeUpArrow,shapeNone),colorYellow,0,C,-10);

Plot(ValueWhen(Short,ShortPrice+StopLoss),"StopLoss",colorRed,1);
Plot(LowestSince(Short, L + ValueWhen
(Short,TrailStop)),"Trailing",colorGreen,1);
Plot(ValueWhen(Short,ShortPrice-Target),"Target",colorBlue,1);

GraphXSpace=1;

SetOption("InitialEquity", 20000 );
MarginDeposit = 1500;
RoundLotSize = 1;
PointValue = 50;
NumContracts = 100;
PositionSize = Min((NumContracts * MarginDeposit),Equity());




<psytek@xxxx> wrote:
> hello stephane,
> 
> my entries are at the open, the signal last only one minute (093000-
093100)
> my exits are supposed to be real time and are independent from the 
entries.
> I used
> 
> SetOption("AllowSameBarExit",True);
> SetOption("ActivateStopsImmediately",True);
> 
> My exitprices in settings are set to Open (should be irrelevant) 
however the
> exit time for my Stops show as 16:00 (Close). No idea what i am 
doing
> wring....
> 
> TIA for any help you can give,
> herman.
> 
> 
>   -----Original Message-----
>   From: Stephane Carrasset [mailto:s.carrasset@x...]
>   Sent: Wednesday, March 31, 2004 6:13 AM
>   To: amibroker@xxxxxxxxxxxxxxx
>   Subject: Re: [amibroker] ApplyStop() in RT
>   Importance: High
> 
> 
>   Herman,
> 
>   I don't understand, do you mean you can't use applystop in real 
time data.
>   because applystop works well in backtesting futures on already 
known
> minutes bar.
> 
>   stephane
>     ----- Original Message -----
>     From: Herman van den Bergen
>     To: AmiBroker YahooGroups
>     Sent: Wednesday, March 31, 2004 4:08 AM
>     Subject: [amibroker] ApplyStop() in RT
> 
> 
>     Can somebody tell me if i can use the ApplyStop() in RT minute 
data?
> 
>     When i inspect the trade list i notice that all stops take 
place at
> 09:31:00 (This system trades at the Open) and i cannot seem to find 
a way to
> make them exit at any other times. My entry signals are at the 
Open... but
> what do i have to do to see my Stops take places at various times 
during the
> day? Is anybody getting stops at different times during the day?
> 
>     btw, the help does not mention RT wrt the ApplyStop... I 
backtest using
> minutes, have stops set to exit immediately, same day exits allowed.
> 
>     TIA for any help you can give.
>     herman.
> 
> 
>     Send BUG REPORTS to bugs@xxxx
>     Send SUGGESTIONS to suggest@xxxx
>     -----------------------------------------
>     Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
>     (Web page: http://groups.yahoo.com/group/amiquote/messages/)
>     --------------------------------------------
>     Check group FAQ at:
> http://groups.yahoo.com/group/amibroker/files/groupfaq.html
> 
> 
> 
>     __________ NOD32 1.699 (20040330) Information __________
> 
>     This message was checked by NOD32 antivirus system.
>     http://www.nod32.com
> 
> 
> 
>   Send BUG REPORTS to bugs@xxxx
>   Send SUGGESTIONS to suggest@xxxx
>   -----------------------------------------
>   Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
>   (Web page: http://groups.yahoo.com/group/amiquote/messages/)
>   --------------------------------------------
>   Check group FAQ at:
> http://groups.yahoo.com/group/amibroker/files/groupfaq.html
> 
> 
>         Yahoo! Groups Sponsor
>               ADVERTISEMENT
> 
> 
> 
> 
> 
> --------------------------------------------------------------------
--------
> --
>   Yahoo! Groups Links
> 
>     a.. To visit your group on the web, go to:
>     http://groups.yahoo.com/group/amibroker/
> 
>     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.



Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.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/