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

[amibroker] Sorry



PureBytes Links

Trading Reference Links

Al,

if I backtest futures, I use applystop, because the stops are often 
in points.
if I backtest stocks, I use my scRem.dll because I can set the 
trailing that I want ( array - amount )

Now in case I choose H-amount
with applystop the stop will be:
HighestSince(Buy, H - ValueWhen(Buy,2*ATR(10)))// if volatile=False
// I have not found a big difference in the results with volatile=TRUE

with scRem.dll it will be
HighestSince(Buy,H - 2*ATR(10)).

scRem.dll can exit at stop value ( like applystop with 
exitatstop=True) or at close ( like applystop if exitatstop=False)

scRem.dll has not the third option of applystop
ExitAtStop = 2 - check High-Low prices but exit NEXT BAR on regular 
trade price.
but I think a stop is made to exit on stop and not on next open!

stephane





> Hi, Stephane:
> 
> OK, I see what you mean. For trailing stops, points are subtracted 
from the HIGH (or added to the LOW for shorts). ApplyStop is hard 
coded for the high or low on trailing stops, so in your last 2 
examples, you could not use ApplyStop. Would your scRem.dll do that? 
> 
> Al Venosa
> 
> 
>   ----- Original Message ----- 
>   From: Stephane Carrasset 
>   To: amibroker@xxxxxxxxxxxxxxx 
>   Sent: Thursday, April 01, 2004 4:31 PM
>   Subject: Re: [amibroker] Re: ApplyStop() in RT
> 
> 
>   Al,
> 
>   Applystops, and I am thinking to stoploss and trailingstop modes, 
are perfect if the amount is written in point.
>   for example 
>   ApplyStop (stopTypeTrailing, stopModePoint, 2*ATR
(10),exitatstop=True,volatile=False,reentrydelay=1) ;
> 
>   you can check the trailing at 
> 
>   Plot(HighestSince(Buy, H - ValueWhen(Buy,2*ATR
(10))),"",colorBlue,1);
> 
>   OR for baktesting futures 
> 
>   ApplyStop (stopTypeTrailing, stopModePoint, 20, 
exitatstop=True,volatile=False,reentrydelay=1) ;
> 
>   you can check the trailing at 
> 
>   Plot(HighestSince(Buy, H - ValueWhen
(Buy,TrailStop)),"Trailing",colorGreen,1);
> 
> 
> 
>   But when you want the stop level was at Ref(Low,-1)  OR  C-2*atr
(10)  OR  Open-30 points,
> 
>   you must scratch your head to set the correct amount, is it from 
Buyprice? or from High?
> 
>   I suppose it is from high...
> 
> 
> 
>   if you want the stop at 
> 
>   HighestSince(Buy,Ref(HIGH,-1) - 2*ATR(10))  OR 
> 
>   HighestSince(Buy,Ref(LOW,-1) - 2*ATR(10))
> 
>   you can't
> 
>    
> 
>    
> 
>   ----- Original Message ----- 
>   From: "Al Venosa" <advenosa@xxxx>
>   To: <amibroker@xxxxxxxxxxxxxxx>
>   Sent: Thursday, April 01, 2004 8:48 PM
>   Subject: Re: [amibroker] Re: ApplyStop() in RT
> 
> 
>   > Stephane:
>   > 
>   > What is it about ApplyStop function you don't like ApplyStop?
>   > 
>   > 
>   > ----- Original Message ----- 
>   > From: "Stephane Carrasset" <s.carrasset@xxxx>
>   > To: <amibroker@xxxxxxxxxxxxxxx>
>   > Sent: Wednesday, March 31, 2004 10:51 AM
>   > Subject: [amibroker] Re: ApplyStop() in RT
>   > 
>   > 
>   > > 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@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 Links
>   > >
>   > >
>   > >
>   > >
>   > >
>   > 
>   > 
>   > 
>   > 
>   > 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 Links
>   > 
>   > 
>   > 
>   >  
>   > 
>   > 
>   > __________ NOD32 1.701 (20040401) 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 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. 
> 
> 
> 
>   ---
>   Outgoing mail is certified Virus Free.
>   Checked by AVG anti-virus system (http://www.grisoft.com).
>   Version: 6.0.634 / Virus Database: 406 - Release Date: 3/18/2004



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/