PureBytes Links
Trading Reference Links
|
--- In <A
href="">amibroker@xxxxxxxxxxxxxxx,
"danielwardadams" <<A
href="">danielwardadams@x...> wrote:>
Stephane,> A couple of weeks ago you sent me some code to trail a stop
after a > certain percent profit had been reached. I'm still struggling
trying > to backtest using EOD Buy signals but exiting on intraday
trailing > stops (after some profit %).> > In all of your
trailing stop code (I've looked at Rem.dll too), you > have lot of "for
(i=0; i< Barcount; i++)" statements. If my backtest > periodicity
is set to 1 minute (so presumably "i" is counting in > minutes), how do I
look at EOD data within (or prior to) your code? > When changing
periodocities, do you have to modify the value of "i"? > My base
interval is 1 minute data.
Hello,
if yours data are minutes bar, below is an example to
get buy signal based on EOD with a looping example
TimeFrameSet( inDaily );
Lchart= H<Ref<FONT
size=1>(H,-1)
AND L<Ref<FONT
size=1>(L,-1);
Top[0<FONT
size=1>]=High[0<FONT
size=1>];
ValBO=0.5<FONT
size=1>;
for( i = <FONT color=#ff00ff
size=1>1 ; i < BarCount; i++ )
{
if
(Lchart[i])
Top[i]=(High[i]*(1<FONT
size=1> + valBO/100));
else
Top[i]=Top[i-1];
}
Buy=<FONT face="Courier New" color=#0000ff
size=1>Cross<FONT face="Courier New"
size=1>(C,Top);
TimeFrameRestore();<FONT face="Courier New"
size=1>
Buy=<FONT color=#0000ff
size=1>TimeFrameExpand(<FONT
face="Courier New" size=1>Buy<FONT
face="Times New Roman">,inDaily);<FONT
face="Courier New" size=1>
Top=<FONT color=#0000ff
size=1>TimeFrameExpand(<FONT
face="Courier New" size=1>Top<FONT
face="Times New Roman">,inDaily);<FONT color=#0000ff
size=1>
Plot(T<FONT
size=1>op,"",<FONT
color=#ff00ff size=1>2,<FONT color=#ff00ff
size=1>1);
Plot(C,<FONT color=#ff00ff
size=1>"",1<FONT
size=1>,64<FONT
size=1>);
PlotShapes(<FONT color=#0000ff
size=1>IIf( Buy,
shapeUpArrow,shapeNone),colorGreen,<FONT
color=#ff00ff size=1>0,L,-<FONT color=#ff00ff
size=1>20);
Stephane
> If I understood this, maybe I'd have a breakthrough in my >
understanding of timeframes. I've read the timeframe tutorial section
> many times but still can't ever get things to work.> >
TIA,> DanSend BUG REPORTS to
bugs@xxxxxxxxxxxxxSend SUGGESTIONS to
suggest@xxxxxxxxxxxxx-----------------------------------------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
__________
NOD32 1.734 (20040424) Information __________This message was checked
by NOD32 antivirus system.<A
href="">http://www.nod32.com
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 the Yahoo! Terms of Service.
|