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

Re: [amibroker] Re: Plot in TimeFrameExpand



PureBytes Links

Trading Reference Links

Barry,
 
Thanks for your help. I'm also using IB and now looking at ER2. Looking at ER2U8 on an hourly chart using 24 hour data, the plotted line moves to the next day's value at 11:30. This would lead you to think that it could be because the next bar starts at 12:30 AM and not at midnight. But if I look at it on a 5 min chart, the plotted value changes at 11:55pm. It should change with the 00:00:00 bar at midnight. Same thing on a 15min or 30 min chart. The plotted value changes to the next days value 1 bar before midnight. On ER2U8, the plotted Rolling Pivot = 658.33 through the 11:50 bar on 7/9/08. Then with the bar at 11:55 it changes to 671.46 and stays there through out the day today. Will you take a look and see when the plot shifts for you on a 5min, 24hour chart.
 
As far as using the same name, I lifted that right off the tutorial on Multiple Time Frame Support. It made no sense to me when I read it, but having no programming training, I really can't operate on my perception of logic. Your differentiation is certainly more logical and I will use that from now on, now that I know it works.
 
The three variables I calculated inDaily display properly in my interpretation window without being expanded. Again, don't know why, but they do. AND, not only do they work, they work right up until midnight. The plotted RPivot change value at 11:55 while the PHigh, PLow, and PClose don't change value until the 00:00:00 bar. Go figure.
 
I really appreciate your time. Amibroker is daunting for those of us with zero programming experience.
James
 
----- Original Message ----
From: Barry Scarborough <razzbarry@xxxxxxxxxxxx>
To: amibroker@xxxxxxxxxxxxxxx
Sent: Wednesday, July 9, 2008 8:54:43 PM
Subject: [amibroker] Re: Plot in TimeFrameExpand

It plots correctly on my system. I tested it on an hour chart. You
have to plot it on the shortest time frame chart you use. If you want
to see it in an hour chart then use an hour chart and the day values
will staircase just as you said. On an hour plot the flat period is 7
bars.

It may seem to jump to the next day's value but remember there are
6.5 hours in a trading day. The hour plot for the "last hour" will
extend into the next day, well not really. I use IB and it gets
weirder since IB does not time stamp their data and my "last bar" is
16:14 but then I also have another "last bar" at 16:15 using ER2
futures contract. Try plotting using 24 hours and see if that makes a
difference. That way you won't have a half hour as the last hour and
will plot differently.

You calculated three other values inDaily. You have to expand them
before you write them to the interpretation window. Also, you use the
same name in the settimeframe and after you expanded it. That may
work but it is confusing. Had you used different names you might have
caught the error of not expanding the other three variables. I would
use something like this. I prefaced the expanded values with an "e"
rather than "r" to differentiate the two.

ePivot = TimeFrameExpand( Rpivot, inDaily );
eHigh = TimeFrameExpand( PHigh, inDaily );
eLow = TimeFrameExpand( PLow, inDaily );
eClose = TimeFrameExpand( PClose, inDaily );

"PHigh: " + NumToStr( eHigh, 1.2 );
"PLow: " + NumToStr( eLow, 1.2 );
"PClose: " + NumToStr( eClose, 1.2 );
Plot(ePivot, "Rolling Pivot",colorLightGr ey);

Barry

--- In amibroker@xxxxxxxxx ps.com, James <jamesmemphis@ ...> wrote:
>
> Hello,
> I cannot figure out how to get the following indicator to plot
correctly using TimeFrameExpand. It always seems to go to the next
days value on the last bar of the previous day. I am looking at this
on ES futures, but it should be the same on stocks. Regardless of the
time frame I have selected, 5min, 15min, 30min, etc. the indicator
staircases to the next days value on the last bar of the day. Doesn't
matter if you are looking at 24 hours or day session. It could
probably be fixed with x-shift, but that wouldn't be the proper fix
because PClose is being calculated improperly.
> Also, is there any way to get rid of the staircases in a line and
just have the horizontal values, ie., just a horizontal line for each
day.
> Thanks in advance,
> James 
>
> SetFormulaName ("Rolling Pivot");
>  TimeFrameSet
> RollPer = Param("Period" , 3, 1, 20, 1);
> PHigh = HHV(Ref(H,-1) ,RollPer) ;
> PLow = LLV(Ref(L,-1) ,RollPer) ;
> PClose = Ref(C,-1);
> RPivot = (PHigh + PLow + Pclose)/3;TimeFrame Restore
> RPivot = TimeFrameExpand( Rpivot,
inDaily );"PHigh: ""PLow: ""PClose: "Plot(RPivot, "Rolling
Pivot",colorLightGr ey); + NumToStr( PClose, 1.2 ); + NumToStr( PLow,
1.2 ); + NumToStr( PHigh, 1.2 );();( inDaily );
>


__._,_.___

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 NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

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




Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___