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

Re: [amibroker] Please, Help Me !...



PureBytes Links

Trading Reference Links

Hi Steve,

1) I want to display on a daily chart the lowest level of the weekly bandwidth (over 120 periods). On the  weekly chart, it corresponds to the green candle (see screenshot below)
Its code is :

BwiH = ( (BBandTop( Avg, 20 ,2 )- BBandBot( Avg, 20 , 2 )) / MA( Avg, 20 ) )*100 ;
LLVBwiH = Ref( LLV( BwiH, 120) ,-1 ) ;
Lowestlevel = BwiH < LLVBwiH ;

2) In order to check the sync on the daily chart, I use the following code :

TimeFrameSet( inWeekly );
BwiH = ( (BBandTop( Avg, 20 ,2 )- BBandBot( Avg, 20 , 2 )) / MA( Avg, 20 ) )*100;
LLVBwiH = Ref(LLV(BwiH, 120),-1) ;
NivH = BwiH < LLVBwiH;

TimeFrameRestore();
NivH = TimeFrameExpand( NivH , inWeekly );

In the screenshot, you can clearly see that the result is false : the green arrows (daily chart) are not in sync with the green candle (weekly chart).
You can check it by yourself : in my example, I used Tektronix, ticker TEK, market SP 500.

Thanks for your valuable help
Regards,
Evo1



Steve Dugas a écrit :
Sorry Evo, guess I misunderstood...
 
Looks like your trouble may be use of Ref() function? I think it will shift the array by one bar in both timeframes, removing a week's worth of data in one case but only a day's worth in the other, causing loss of sync. You could try using Ref( ...,-5 ), but then there are the 4-day weeks...   Or you could try expanding the weekly bars before operating on them....    What exactly are you looking to do?
 
Steve 


Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.html





YAHOO! GROUPS LINKS




JPEG image