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

Re: [amibroker] Timeframeset gives wrong results



PureBytes Links

Trading Reference Links

The variables firstallup and firstalldown seem to be both defined in
the base time period.
They should be defined within each timeframeset blocks of the code.

-- 
Cheers
Graham Kav
AFL Writing Service
http://www.aflwriting.com




2009/5/27 allm4m <allm4m@xxxxxxxxx>:
> Hello, here's what I want to do (but can't get it right):
>
> I want to scan for 30min bar buy/short signals, produced by my indicator, but I only want those signals that are confirmed by a signal given in the last 10 or 15 min bar (the one that ends the same time as the 30min bars, or the one just before).
>
> Here's the code (after the indicator code) that I thought should work on a scan set at 5min bars:
>
> TimeFrameSet( 2*in5Minute );
> GreenSq10 = firstallup OR Ref(firstallup, -1);
> RedSq10 = firstalldown OR Ref(firstalldown, -1);
>
> TimeFrameSet( in15Minute );
> GreenSq15 = firstallup OR Ref(firstallup, -1);
> RedSq15 = firstalldown OR Ref(firstalldown, -1);
>
> TimeFrameSet( 2*in15Minute );
> GreenSq30 = firstallup;
> RedSq30 = firstalldown;
>
> TimeFrameRestore();
>
> GreenSq10 = TimeFrameExpand(GreenSq10, 2*in5Minute, expandLast );
> RedSq10 = TimeFrameExpand(RedSq10, 2*in5Minute, expandLast );
> GreenSq15 = TimeFrameExpand(GreenSq15, in15Minute, expandLast );
> RedSq15 = TimeFrameExpand(RedSq15, in15Minute, expandLast );
> GreenSq30 = TimeFrameExpand(GreenSq30, 2*in15Minute, expandLast );
> RedSq30 = TimeFrameExpand(RedSq30, 2*in15Minute, expandLast );
>
> Buy = GreenSq30 AND ( GreenSq10 OR GreenSq15);
> Short = RedSq30 AND ( RedSq10 OR RedSq15);
>
> There are two problems with this code:
> 1. I get wrong results, i.e. many results appear that have no signal at all.
> 2. I get results at times other than ending xx:29 or xx:59. Instead I get 5 min bar results, like 10:04 etc. Most results are in clusters of 3-5 consecutive 5 min bars (e.g. 13:09, 13:14 and 13:19) which isn't OK either.
>
> Even when I leave out the confirming signals (so just Buy = GreenSq30;) I get wrong results.
>
> When instead of doing a scan, I plot the signals in the indicator, I get undesired effects like (wrong) signals disappearing while scrolling.
>
> Who can tell me how I should change the code?
> Thanks.
>
>
>


------------------------------------

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to 
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> 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/