PureBytes Links
Trading Reference Links
|
Harold,
Here is an example code that uses rembuy.dll:
BuyCond=<your buy conditions>; //whatever rules you want as your
entry setup
tm=Optimize("tm",4,2,5,0.5); //ATR multiplier for trailing
stopim=Optimize("im",2.5,1,4,0.5); //ATR multiplier for initial protective
stoppds=Optimize("pds",20,10,26,3); //ATR periodsBuy=Ref(BuyCond,-1);
//entry at open one day after buy signalBuy=Hold(Buy==0,2) AND Buy;//convert
to one bar peakEP=Open;//entry price is the open on the day of the
buyProfit=EP*1000000000000000000000;//big number to eliminate profit
targetStoploss=ValueWhen(Buy,O-im*ATR(pds));//hard initial
stoplossTrailstop=H-tm*ATR(pds);//the trailing stopCapital =
100000;//starting equityRisk=0.01*Capital;//risk per
tradePositionSize=Risk/(im*ATR(pds))*EP;//position size code that risks a
maximum of 1% of equityBars=-1;//eliminates a timed exit (a positive number
means you have a timed
exit)scRemBuyTrail(Buy,Close,EP,Stoploss,Profit,Trailstop,Bars);//the call
of the rembuy.dllBuy=Buy;//ensures buy is an arraySell=Sell;//ensures
sell is an
arrayBuyPrice=EP;SellPrice=Open;Short=0;Cover=0;EP=ValueWhen(Buy,EP);//for
plotting purposesIStop=ValueWhen(Buy,Stoploss);//for plotting
purposesTStop=HighestSince(Buy,Trailstop);//for plotting purposes
So, the scRemBuyTrail is the key. It calls the functions within the dll,
and you have to have all the factors shown within parentheses, even though you
might not utilize all of them. In the example above, there is no profit target
and no timed exit. If you choose to use the open rather than the close as your
exit, change the Close to Open within the parentheses in the call function.
That's about it. I'm sure Stephane will come up with other and better
explanations, since he wrote the program. Hope this helps you get started.
Al Venosa
<BLOCKQUOTE
>
----- Original Message -----
<DIV
>From:
Harold T.
Harper
To: <A title=amibroker@xxxxxxxxxx
href="">amibroker@xxxxxxxxxxxxxxx
Sent: Thursday, October 10, 2002 4:15
PM
Subject: RE: [amibroker] Re:
rembuy.dll
Stephane,Thanks in advance for your help. I really
appreciate it.Also, your help file is fine for most, I'm
sure--unfortunately, when itcomes to programming, I'm a
dunce.Thanks, Stephane.Harold Harper<A
href="">harold@xxxx-----Original
Message-----From: Stephane Carrasset [mailto:nenapacwanfr@xxxx]
Sent: Thursday, October 10, 2002 2:51 PMTo:
amibroker@xxxxxxxxxxxxxxxSubject: [amibroker] Re:
rembuy.dllHarold,for several reasons ( profession.) the
only thing I can do is to give an example with explanations. because of my
good franglish !!!, it takes too much time to write better help
files.i'll write an example tonite in a few hours, just before going to
bedstephane> Does anyone have a 'cheat sheet' of
sorts for the rembuy.dll.> > I'm looking for a list of functions
available, syntax, examples,etc. > I've looked at the help file in
the 3rd party directory and am a> little confused.> > The
dll looks to be, however, exactly what I need.> > Any help would
be greatly appreciated.> > Thanks!> > Harold
Harper> harold@xxxxPost AmiQuote-related messages ONLY
to: amiquote@xxxxxxxxxxxxxxx (Web page: <A
href="">http://groups.yahoo.com/group/amiquote/messages/)Check
group FAQ at:<A
href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Your use of Yahoo! Groups is subject to<A
href="">http://docs.yahoo.com/info/terms/
Post
AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: <A
href="">http://groups.yahoo.com/group/amiquote/messages/)Check
group FAQ at: <A
href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Your use of Yahoo! Groups is subject to the <A
href="">Yahoo! Terms of Service.
|