Discussions
»
Product and Service Development
»
Formula Assistance
»
Only display pivot levels for bars displayed in the chart
Rank: Newbie
Groups: Registered, Registered Users Joined: 5/21/2007(UTC) Posts: 6
|
Is there a way or a global variable where I can find the number of bars displayed in the chart. I want to display all the pivot point lines R3 to S1, but only those that are relevant to the bars displayed. Otherwise the chart usually gets compressed too much on the vertical axis.
Thank you for helping.
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 12/14/2009(UTC) Posts: 140 Location: Austria
|
this formula should work: x:=Cum(1); LastValue(x);
|
|
|
|
Rank: Newbie
Groups: Registered, Registered Users Joined: 5/21/2007(UTC) Posts: 6
|
Thanks,
But this is not what I am looking for.
This counts the total number of bars loaded. Not the number of bars displayed in the chart a certain moment in time. The display of the pivot levels should be adapted to the visible bars in the chart, not the total number of bars loaded.
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 12/14/2009(UTC) Posts: 140 Location: Austria
|
I never heard of a formula/variable which returns you the numer of bars on your display.. I only know the simulation variables.. which gives you such information for the simulation.. maybe the formula support of equis can help you further...?
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Unverified Users Joined: 10/7/2007(UTC) Posts: 52 Location: Melbourne
Was thanked: 1 time(s) in 1 post(s)
|
Sylvestro..........was wondering if you had ever found a solution for this as I was looking for the same?
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers, Unverified Users Joined: 10/28/2004(UTC) Posts: 3,111 Location: Perth, Western Australia
Was thanked: 16 time(s) in 16 post(s)
|
There's no programmatic interface to the GUI, so there's no way in MS to tell the zoom level i.e. the number of bars being displayed on the current screen.
If you need to limit the information being displayed, like the OP needed years ago when this thread was started, simply limit the computation of the indicators to the required bars by using ValueWhen() or BarsSince().
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Unverified Users Joined: 10/7/2007(UTC) Posts: 52 Location: Melbourne
Was thanked: 1 time(s) in 1 post(s)
|
Thanks Wabbit, that was useful. I was plotting daily pivot levels on 60 min charts but to avoid the screen looking compressed I only wanted the data from the present pivot levels to be displayed. I looked at your code from http://forum.equis.com/f...60/ShowThread.aspx#35760 and the LastValue function is fine for my purpose. Although the last value is displayed across the entire screen there is no screen compression.
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers, Unverified Users Joined: 10/28/2004(UTC) Posts: 3,111 Location: Perth, Western Australia
Was thanked: 16 time(s) in 16 post(s)
|
On an intraday chart you can limit the drawing of an indicator to, for example, just the last day: Code:
ind:={your indicator};
d:=DayOfMonth();
m:=Month();
y:=Year();
test:=d=LastValue(d) AND m=LastValue(m) AND y=LastValue(y);
{plot}
ind * ValueWhen(1,test=1,test);
It's using the same principles as described in the link you provided.
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Unverified Users Joined: 10/7/2007(UTC) Posts: 52 Location: Melbourne
Was thanked: 1 time(s) in 1 post(s)
|
Thanks again Wabbit, I've plotted your suggestion and that's even better but with one drawback for me. My code for daily pivots on an intraday 60 min timeframe is calculated on the H,L and C from 10.00pm to 10.00.pm following the times for banks resetting their servers. Is there any way that my indicator can be displayed for only the past day starting from 10pm rather than midnight or as a compromise for the past two days?
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers, Unverified Users Joined: 10/28/2004(UTC) Posts: 3,111 Location: Perth, Western Australia
Was thanked: 16 time(s) in 16 post(s)
|
So... count all the instances of the first bar on or at 10:00pm, and then compare the individual count of these with the LastValue() instance.
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Unverified Users Joined: 10/7/2007(UTC) Posts: 52 Location: Melbourne
Was thanked: 1 time(s) in 1 post(s)
|
created just about every sqiggley line imaginable and reread formula primer and the best I can do is plotting from midnight rather than 10 pm......must be something simple. Any chance you might put me out of my misery?
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers, Unverified Users Joined: 10/28/2004(UTC) Posts: 3,111 Location: Perth, Western Australia
Was thanked: 16 time(s) in 16 post(s)
|
Post up your best attempt and I'll have a look at correcting (where necessary)...
I'm just about to head out the door for a weekend away so please don't expect an answer until I get back home on Monday.
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Unverified Users Joined: 10/7/2007(UTC) Posts: 52 Location: Melbourne
Was thanked: 1 time(s) in 1 post(s)
|
My 'best attempt' is superceeded by "rayhhc" of Yahoo Metastock Group; The following code does a neat job of plotting my indicator over the last 24 bars which is fine for my 1 hour chart but of course another drawdack would be if I move it down to a half hour chart the indicator covers only the last 12 hours. The code to plot the indicator from 10.00pm rather than rely on the number of bars is what escapes me. I've a feeling that Henry alluded to this in his post on Jacksons pivots elsewhere in the Forum, if I can take it apart. Anyway here is "rayhhc" code which I have only altered descriptions so as not to confuse with names of pivot levels.
ind:={my indicator};
b:=LastValue(Cum(1)-1)=Cum(1);
vw:=ValueWhen(1,b,ind);
lv:=LastValue(vw);
b1:=LastValue(Cum(1)-24)=Cum(1);
{plot}
ValueWhen(1,b1,lv);
Normal
0
false
false
false
EN-AU
X-NONE
X-NONE
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin:0cm;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman","serif";}
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers, Unverified Users Joined: 10/28/2004(UTC) Posts: 3,111 Location: Perth, Western Australia
Was thanked: 16 time(s) in 16 post(s)
|
Try something like: Code:
hh:=22; {10 pm = 22:00}
ind:={your indicator}
test:=Hour()=hh;
signal:=test AND Alert(test=0,2);
counter:=Cum(signal);
{plot}
ValueWhen(1,counter = LastValue(counter), ind);
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Unverified Users Joined: 10/7/2007(UTC) Posts: 52 Location: Melbourne
Was thanked: 1 time(s) in 1 post(s)
|
Thanks Wabbit, I'll try this this evening and get back to you.
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Unverified Users Joined: 10/7/2007(UTC) Posts: 52 Location: Melbourne
Was thanked: 1 time(s) in 1 post(s)
|
Great, this is perfect for what I need and saves a lot of time as previously I would calculate pivot levels using Excel, and then plot manually on the chart. Of course if the levels are too wide apart there is still screen compression but , as you said earlier, that's a limitation of MS, but even then it's simple to adjust the number of pivots on display. Appreciate all your help.
|
|
|
|
Users browsing this topic |
Guest (Hidden)
|
Discussions
»
Product and Service Development
»
Formula Assistance
»
Only display pivot levels for bars displayed in the chart
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.