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

[amibroker] Re: Plot in TimeFrameExpand



PureBytes Links

Trading Reference Links

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",colorLightGrey);


Barry

--- In amibroker@xxxxxxxxxxxxxxx, James <jamesmemphis@xxx> 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;TimeFrameRestore
> RPivot = TimeFrameExpand( Rpivot, 
inDaily );"PHigh: ""PLow: ""PClose: "Plot(RPivot,"Rolling 
Pivot",colorLightGrey); + 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
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/