PureBytes Links
Trading Reference Links
|
Stephane,
Many thanks. I'll play with it and may have questions later.
I hate to have to have other people solve my problems but it sure is nice to know people like you are on this thread for when you really get stuck.
DanStephane Carrasset <s.carrasset@xxxxxxxxxxx> wrote:
--- In amibroker@xxxxxxxxxxxxxxx, "danielwardadams" <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(H,-1) AND L<Ref(L,-1);
Top[0]=High[0];
ValBO=0.5;
for( i = 1 ; i < BarCount; i++ )
{
if (Lchart[i])
Top[i]=(High[i]*(1 + valBO/100));
else
Top[i]=Top[i-1];
}
Buy=Cross(C,Top);
TimeFrameRestore();
Buy=TimeFrameExpand(Buy,inDaily);
Top=TimeFrameExpand(Top,inDaily);
Plot(Top,"",2,1);
Plot(C,"",1,64);
PlotShapes(IIf( Buy, shapeUpArrow,shapeNone),colorGreen,0,L,-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: http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check group FAQ at: 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@xxxxxxxxxxxxxSend 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
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 Sponsor
ADVERTISEMENT
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.
|