Print Page | Close Window

Intraday trading Support and resistance and trend

Printed From: BullCharts Forum
Category: BullCharts
Forum Name: BullScript
Forum Discription: Technical discussion related specifically to the BullScript programming language.
URL: http://www.bullcharts.com.au/forum/forum_posts.asp?TID=877
Printed Date: 19 May 2024 at 6:51am
Software Version: Web Wiz Forums 9.69 - http://www.webwizforums.com


Topic: Intraday trading Support and resistance and trend
Posted By: cmacdon
Subject: Intraday trading Support and resistance and trend
Date Posted: 28 Dec 2012 at 2:48pm

Various writers Linda Bradford Rashke,  Al Brooks , Mark B. Fisher when discussing intraday trading suggests that the High or Low of the previous Day are important support and resistance levels for the next days trading decisions.

Here are a couple of indicators that show the previous day’s High and Low levels. The Highs or lows are drawn horizontally 1 bar at a time whilst each of the following day’s  similar time periods elapses.

Depending on the intraday time frame adopted ,the setting of the indicator should be changed e.g. there are 24 X 15 minute periods in 6 hours of ASX trading so if you use a 15 minute chart the setting is 24.  A 5 minute chart has a setting of 72 etc.  The settings identify the bars in the previous day for the indicator to do its thing measuring the highest  high or low over that indicator period.

 

You can also go into Advance tab and do a Horizontal shift of -24 or  -72 and the high and low will be shifted to the day before.   Once set up I save as templates for 5 min, 15 min and hourly charts.

I put on some Gann levels for: 25%, 50% 75%, 33% and 66% between the Highs and lows for interest so you can see if current price is starting to get relatively stronger of weaker.

The bars have been color coded for position of the close of a new bar relative to yesterday’s support and resistance or for breaking outside yesterday’s high or low.  (Cyan if close is above yesterdays high, Lime if close is above the 50% level of yesterday and  below yesterday’s high. Red if below the 50% level and above yesterday’s low and black if the bar is below yesterday’s low).

The second indicator is similar but the comparative High and Low resistance is for the previous hour rather than yesterday.

(The indicator is not so good if there are public holiday intraday time periods so charts below show more normalized trading periods).

Also below is a code for similar logic but a new bar is coloured relative the high or low of the previous hour's high or low.

 

 



-------------
BC User since June 2007



Replies:
Posted By: cmacdon
Date Posted: 28 Dec 2012 at 2:49pm


-------------
BC User since June 2007


Posted By: cmacdon
Date Posted: 28 Dec 2012 at 2:50pm


-------------
BC User since June 2007


Posted By: cmacdon
Date Posted: 28 Dec 2012 at 2:54pm
Code for 15 minute bars compared to day before High or Low.
 
I forgot to mention I also

[target

=price; author= C MacDonald; ]

 

{ e.g 24 for 15minute charts and 60 for 5 min charts}

n :=

input("Divide 6 hours by intraday time period",24);

{ This is intended to only show indicators at begining of the day so can position for day trading without clutter}

{Identifies first bar of the day See Definition under Hour in Help}

prelimOpBar:=

if(Hour<hist(Hour,1),1,undefined);

OpBar:=

if(Hist(prelimOpBar,1) OR Hist(prelimOpBar,2) OR Hist(prelimOpBar,3) OR Hist(prelimOpBar,4) OR Hist(prelimOpBar,5) OR Hist(prelimOpBar,6) OR Hist(prelimOpBar,7) OR Hist(prelimOpBar,8) OR Hist(prelimOpBar,9) OR Hist(prelimOpBar,10) OR Hist(prelimOpBar,11) OR Hist(prelimOpBar,12) OR Hist(prelimOpBar,13) OR Hist(prelimOpBar,14) OR Hist(prelimOpBar,15) OR Hist(prelimOpBar,16) OR Hist(prelimOpBar,17) OR Hist(prelimOpBar,18) OR Hist(prelimOpBar,19) OR Hist(prelimOpBar,20) OR Hist(prelimOpBar,21) OR Hist(prelimOpBar,22) OR Hist(prelimOpBar,23) OR Hist(prelimOpBar,24), 1,undefined);

{Identifies first bar of the day See Definition under Hour in Help}

[name

=Maxed Out Ultra High Vol; Width=1; linestyle=verticalmarker; Color=Black] { Ultra High Volume}

if

(Hour<hist(Hour,1),c,undefined);

[linestyle

=horz step]

a:=

if(prelimOpBar,highest(Hist(High,1),n),undefined);

a;

b:=

if(prelimOpBar,Lowest(Hist(Low,1),n),undefined);

b;

 

[linestyle

=horz step; color=Black; Width=2;]

G50:=b+0.5*(a-b);

G50;

[linestyle

=dotted step; color=Blue; Width=1;]

G75:=b+0.75*(a-b);

G75;

G25:=b+0.25*(a-b);

G25;

[linestyle

=dotted step; color=red;]

G66:=b+0.666666*(a-b);

G66;

G33:=b+0.333333*(a-b);

G33;

 

[name

=Fill; linestyle=fill step;

color

=Cyan;]

a; b;

[linestyle

=pricecolor]

[color

=Cyan] If (Opbar=1 AND Close>=valuewhen(1,prelimOpBar,a),1,undefined);

 

[color

=Lime] If (Opbar=1 AND Close>=valuewhen(1,prelimOpBar,g50),1,undefined);

 

[color

=Black] If (Opbar=1 AND Close<valuewhen(1,prelimOpBar,b),1,undefined);

 

[color

=Red] If (Opbar=1 AND Close<valuewhen(1,prelimOpBar,g50),1,undefined);

 

[color

=Blue] true;

{This adds single tezxt calc of the daily spread as a %}

Spreadtxt :=

Valuewhen(prelimOpBar,((a/b)-1)*100);

{This part displays the latest daily spread as a percentage}

sptx:=

IF(systemdate=Systemdate ,SpreadTxt, Undefined);

[linestyle

=Text; textalign=Above,Left; target=price; visible=yes]

if

(barnumber=lastvalue(barnumber), Round(sptx,2) + "% Spread

DB4"

, undefined);Low*0.98;

put in a clculation on curent day of teh % price spread of the day before
 
 


-------------
BC User since June 2007


Posted By: cmacdon
Date Posted: 28 Dec 2012 at 2:59pm
On the code posted above change the indicator setting to 72 not 60 (i.e 12 X 5mins per hour X 6 Hours per trading day
Below  is code for 5 minute bars compared to previous hour high or Low
 

[target

=price; author= C MacDonald; ]

 

{ e.g 24 for 15minute charts and 72 for 5 min charts}

n :=

input("Divide 6 hours by intraday time period",72);

{ This is intended to only show indicators at begining of the day so can position for day trading without clutter}

{Identifies first bar of the day See Definition under Hour in Help}

prelimOpBar:=

if(Minute<hist(Minute,1),1,undefined);

OpBar:=

if(Hist(prelimOpBar,1) OR Hist(prelimOpBar,2) OR Hist(prelimOpBar,3) OR Hist(prelimOpBar,4) OR Hist(prelimOpBar,5) OR Hist(prelimOpBar,6) OR Hist(prelimOpBar,7) OR Hist(prelimOpBar,8) OR Hist(prelimOpBar,9) OR Hist(prelimOpBar,10) OR Hist(prelimOpBar,11) OR Hist(prelimOpBar,12) OR Hist(prelimOpBar,13) OR Hist(prelimOpBar,14) OR Hist(prelimOpBar,15) OR Hist(prelimOpBar,16) OR Hist(prelimOpBar,17) OR Hist(prelimOpBar,18) OR Hist(prelimOpBar,19) OR Hist(prelimOpBar,20) OR Hist(prelimOpBar,21) OR Hist(prelimOpBar,22) OR Hist(prelimOpBar,23) OR Hist(prelimOpBar,24) OR Hist(prelimOpBar,25) OR Hist(prelimOpBar,26) OR Hist(prelimOpBar,27) OR Hist(prelimOpBar,28) OR Hist(prelimOpBar,29) OR Hist(prelimOpBar,30) OR Hist(prelimOpBar,31) OR Hist(prelimOpBar,32) OR Hist(prelimOpBar,33) OR Hist(prelimOpBar,34) OR Hist(prelimOpBar,35) OR Hist(prelimOpBar,36) OR Hist(prelimOpBar,37) OR Hist(prelimOpBar,38) OR Hist(prelimOpBar,39) OR Hist(prelimOpBar,40) OR Hist(prelimOpBar,41) OR Hist(prelimOpBar,42) OR Hist(prelimOpBar,43) OR Hist(prelimOpBar,44) OR Hist(prelimOpBar,45) OR Hist(prelimOpBar,46) OR Hist(prelimOpBar,47) OR Hist(prelimOpBar,48) OR Hist(prelimOpBar,49) OR Hist(prelimOpBar,50) OR Hist(prelimOpBar,51) OR Hist(prelimOpBar,52) OR Hist(prelimOpBar,53) OR Hist(prelimOpBar,54) OR Hist(prelimOpBar,55) OR Hist(prelimOpBar,56) OR Hist(prelimOpBar,57) OR Hist(prelimOpBar,58) OR Hist(prelimOpBar,59) OR Hist(prelimOpBar,60) OR Hist(prelimOpBar,61) OR Hist(prelimOpBar,62) OR Hist(prelimOpBar,63) OR Hist(prelimOpBar,64) OR Hist(prelimOpBar,65) OR Hist(prelimOpBar,66) OR Hist(prelimOpBar,67) OR Hist(prelimOpBar,68) OR Hist(prelimOpBar,69) OR Hist(prelimOpBar,70) OR Hist(prelimOpBar,71) OR Hist(prelimOpBar,72), 1,undefined);

 

{Identifies first bar of the day See Definition under Hour in Help}

[name

=Maxed Out Ultra High Vol; Width=1; linestyle=verticalmarker; Color=Black] { Ultra High Volume}

if

(Minute<hist(Minute,1),c,undefined);

 

 

[linestyle

=horz step]

a:=

if(prelimOpBar,highest(Hist(High,1),n),undefined);

a;

b:=

if(prelimOpBar,Lowest(Hist(Low,1),n),undefined);

b;

 

[linestyle

=horz step; color=Black; Width=2;]

G50:=b+0.5*(a-b);

G50;

[linestyle

=dotted step; color=Blue; Width=1;]

G75:=b+0.75*(a-b);

G75;

G25:=b+0.25*(a-b);

G25;

[linestyle

=dotted step; color=red;]

G66:=b+0.666666*(a-b);

G66;

G33:=b+0.333333*(a-b);

G33;

 

 

[name

=Fill; linestyle=fill step;

color

=Cyan;]

a; b;

 

[linestyle

=pricecolor]

 

[color

=Cyan] If (Opbar=1 AND Close>=valuewhen(1,prelimOpBar,a),1,undefined);

 

[color

=Lime] If (Opbar=1 AND Close>=valuewhen(1,prelimOpBar,g50),1,undefined);

 

[color

=Black] If (Opbar=1 AND Close<valuewhen(1,prelimOpBar,b),1,undefined);

 

[color

=Red] If (Opbar=1 AND Close<valuewhen(1,prelimOpBar,g50),1,undefined);

 

 

 

 

 

 

 

[color

=Blue] true;



-------------
BC User since June 2007


Posted By: cmacdon
Date Posted: 28 Dec 2012 at 3:17pm
Sorry forget my short note immediatly above, I am confusing myself with different time periods
The First code is correct with 24 setting for a 15 minute bar chart and 24 bars identified in the Opbar definition
 
Second code is correct for a setting of 72 for 5 minute charts and 72 bars coded in the Opbar definition.
 
 
 
Charles


-------------
BC User since June 2007


Posted By: paulchow2k
Date Posted: 05 Jun 2013 at 11:50pm
Hi Charles,
Regarding intraday over the weekend or holidays, I find that using course of trades to find where price creates support and resistance levels. So on each bar, I could tell where support and resistance is.

I just don't know if there is a bullcharts script for that.

Regards

Paul


Posted By: cmacdon
Date Posted: 06 Jun 2013 at 7:09am
Paul

I do not use Course of Trades Report from Bull charts but it seems to be just Price level x Volume = Value of trades.

If you look at the Natural Support and Resistance Based on Volume posts in this Forum I think you can find a Volume Multiplier you can use on intraday charts that will save you a lot of time analyzing a course of trades report.

I will post two examples below for a 10 Minute and 30 Minute charts showing that playing around with the Volume Multiplier finds the main Support levels.



-------------
BC User since June 2007


Posted By: cmacdon
Date Posted: 06 Jun 2013 at 7:10am


-------------
BC User since June 2007


Posted By: cmacdon
Date Posted: 06 Jun 2013 at 7:13am

The only variation I have done to the previous volume Multiplier indicators is that these ones now colour fill the multiplier range according to whether the price is in a relative up or down trend relative to that support or resistance range.

-------------
BC User since June 2007


Posted By: cmacdon
Date Posted: 06 Jun 2013 at 7:16am
In first chart above I incorrectly typed "resistance" when I mean "Support". Never was a typist.

-------------
BC User since June 2007


Posted By: cmacdon
Date Posted: 06 Jun 2013 at 7:55am
Paul

Just remembered an old indicator in my archives I once converted to Bullcharts from Tradersonline which may also help you avoid analyzing the Course of Trades report.

It is called Price by Volume 25 and was originally written by Roy Larsen in Metastock Code. I obtained it from Tradersonline.tk and converted it to Bullcharts.

It effectively puts the prices achieved into volume buckets ( in this case 25 Buckets) you can play with code to make as many buckets as your want but 25 appears reasonable. So it shows you how much volume traded at various prices over the course of the sample. Also you have to vary the parameters for the number of bars you want included in the sample and also scale the bars so they appear on the screen in a reasonable size histogram.

Below is BHp again with intraday sample.



-------------
BC User since June 2007


Posted By: cmacdon
Date Posted: 06 Jun 2013 at 7:57am

{C2006 Roy Larsen, www.metastocktips.com}

[Target=Price;]

d:=input("Bars to Include", 100, 1, 9999);
n:=input("Scaling Factor", 25, 1, 999);
k:=input("Plot Frame?", 1, 0, 1);
y:=Cum(1);
f:=LastValue(y);
z:=f-1=y;
d1:=LastValue(If(d>=f,f-1,d));
a:=(f-d<y)*(y>1);
g:=a*V;
b:=LastValue(Cum(g));
q:=LastValue(HighestSince(1,a=0,C));
r:=LastValue(LowestSince(1,a=0,C));
i:=(q-r)/25;
u:=r+i*.5;
m:=n*d/b;
x1:=LastValue(Cum((C<(r+i))*g));
ValueWhen(1,f-x1*m<y,u);
x2:=LastValue(Cum((C>=(r+i))*(C<(r+i*2))*g));
ValueWhen(1,f- x2*m<y,u+i);
x3:=LastValue(Cum((C>=(r+i*2))*(C<(r+i*3))*g));
ValueWhen(1,f- x3*m<y,u+i*2);
x4:=LastValue(Cum((C>=(r+i*3))*(C<(r+i*4))*g));
ValueWhen(1,f- x4*m<y,u+i*3);

x5:=LastValue(Cum((C>=(r+i*4))*(C<(r+i*5))*g));
ValueWhen(1,f- x5*m<y,u+i*4);
x6:=LastValue(Cum((C>=(r+i*5))*(C<(r+i*6))*g));
ValueWhen(1,f- x6*m<y,u+i*5);
x7:=LastValue(Cum((C>=(r+i*6))*(C<(r+i*7))*g));
ValueWhen(1,f- x7*m<y,u+i*6);
x8:=LastValue(Cum((C>=(r+i*7))*(C<(r+i*8))*g));
ValueWhen(1,f- x8*m<y,u+i*7);

x9:=LastValue(Cum((C>=(r+i*8))*(C<(r+i*9))*g));
ValueWhen(1,f- x9*m<y,u+i*8);
x10:=LastValue(Cum((C>=(r+i*9))*(C<(r+i*10))*g));
ValueWhen(1,f- x10*m<y,u+i*9);
x11:=LastValue(Cum((C>=(r+i*10))*(C<(r+i*11))*g));
ValueWhen(1,f- x11*m<y,u+i*10);
x12:=LastValue(Cum((C>=(r+i*11))*(C<(r+i*12))*g));
ValueWhen(1,f- x12*m<y,u+i*11);

x13:=LastValue(Cum((C>=(r+i*12))*(C<(r+i*13))*g));
ValueWhen(1,f- x13*m<y,u+i*12);
x14:=LastValue(Cum((C>=(r+i*13))*(C<(r+i*14))*g));
ValueWhen(1,f- x14*m<y,u+i*13);
x15:=LastValue(Cum((C>=(r+i*14))*(C<(r+i*15))*g));
ValueWhen(1,f- x15*m<y,u+i*14);
x16:=LastValue(Cum((C>=(r+i*15))*(C<(r+i*16))*g));
ValueWhen(1,f- x16*m<y,u+i*15);


x17:=LastValue(Cum((C>=(r+i*16))*(C<(r+i*17))*g));
ValueWhen(1,f- x17*m<y,u+i*16);
x18:=LastValue(Cum((C>=(r+i*17))*(C<(r+i*18))*g));
ValueWhen(1,f- x18*m<y,u+i*17);
x19:=LastValue(Cum((C>=(r+i*18))*(C<(r+i*19))*g));
ValueWhen(1,f- x19*m<y,u+i*18);
x20:=LastValue(Cum((C>=(r+i*19))*(C<(r+i*20))*g));
ValueWhen(1,f- x20*m<y,u+i*19);


x21:=LastValue(Cum((C>=(r+i*20))*(C<(r+i*21))*g));
ValueWhen(1,f- x21*m<y,u+i*20);
x22:=LastValue(Cum((C>=(r+i*21))*(C<(r+i*22))*g));
ValueWhen(1,f- x22*m<y,u+i*21);
x23:=LastValue(Cum((C>=(r+i*22))*(C<(r+i*23))*g));
ValueWhen(1,f- x23*m<y,u+i*22);
x24:=LastValue(Cum((C>=(r+i*23))*(C<(r+i*24))*g));
ValueWhen(1,f- x24*m<y,u+i*23);


x25:=LastValue(Cum((C>=(r+i*24))*(C<(r+i*25))*g));
ValueWhen(1,f-Int(x25*m)=y,u+i*24);
x26:=(f-d=y)*k;
ValueWhen(1,x26,q);ValueWhen(1,Alert(x26,2),If(x26,q,r));
{c;}
{end}



-------------
BC User since June 2007


Posted By: cmacdon
Date Posted: 06 Jun 2013 at 8:01am


-------------
BC User since June 2007


Posted By: paulchow2k
Date Posted: 07 Oct 2013 at 3:47pm
Thanks for that mate! Ive been away for a while but that looks like it. Anyway of adding colours or per day? More like Market Profile

http://en.wikipedia.org/wiki/Market_profile
http://www.fin-alg.com/final/products/

regards

paul


Posted By: cmacdon
Date Posted: 07 Oct 2013 at 4:48pm
Paul


The indicator does not stop you adding any of the Bullchart colored bar criteria to the bars. Right click on a price bar and go to the color tab that then appears, and choose a Bullchart color bar option.

Alternatively you can color your own criteria for bars using Bullscript.

Here is a variation code to play around with. I will post Picture then code.

I made a 50 Volume by price indicator with buckets and colored the Histogram bars according to whether it was buying or selling volume according to Larry Williams Criteria for buying or selling volume (refer Smart Money and Herd separate post for explanation of that crieria).

As both SM and Herd Buying and selling can go on within same day or across various days, two histogram colors (and one wider then the other is needed to show what buying and selling is going on within each bucket).

Charles




-------------
BC User since June 2007


Posted By: cmacdon
Date Posted: 07 Oct 2013 at 4:50pm


-------------
BC User since June 2007


Posted By: cmacdon
Date Posted: 07 Oct 2013 at 4:51pm




{C2006 Roy Larsen, www.metastocktips.com}

[Target=Price;]

Value1 := Volume;
Value1a := (((H-C)/(H-L))*Volume); {Selling Vol}
Value2 := (((C-L)/(H-L))*Volume); {Buying Vol}
Value3 := If((Value2-Value1a) >0,(Value2-Value1a),undefined); {Net of buying and Selling Vol needs to be +'ve to plot on Histogram}
Value4 := If((Value1a-Value2) >0,(Value1a-Value2),undefined); {Net of buying and Selling Vol needs to be +'ve to plot on Histogram}

d:=input("Bars to Include", 100, 1, 9999);
n:=input("Scaling Factor", 4, 1, 999);
k:=input("Plot Frame?", 1, 0, 1);
y:=Cum(1);
f:=LastValue(y);
z:=f-1=y;
d1:=LastValue(If(d>=f,f-1,d));
a:=(f-d<y)*(y>1);
g:=a*V;
g1:=a*Value3;
g2:=a*Value4;


{Query Below if I have the scaleing factors right using g but not also ga ????}
b:=LastValue(Cum(g));
q:=LastValue(HighestSince(1,a=0,C));
r:=LastValue(LowestSince(1,a=0,C));
i:=(q-r)/50;
u:=r+i*.5;
m:=n*d/b;










[name=Net Buying; color=Cyan; width=9;]
x1:=LastValue(Cum((C<(r+i))*g1));
ValueWhen(1,f-x1*m<y,u);
x2:=LastValue(Cum((C>=(r+i))*(C<(r+i*2))*g1));
ValueWhen(1,f- x2*m<y,u+i);
x3:=LastValue(Cum((C>=(r+i*2))*(C<(r+i*3))*g1));
ValueWhen(1,f- x3*m<y,u+i*2);
x4:=LastValue(Cum((C>=(r+i*3))*(C<(r+i*4))*g1));
ValueWhen(1,f- x4*m<y,u+i*3);

x5:=LastValue(Cum((C>=(r+i*4))*(C<(r+i*5))*g1));
ValueWhen(1,f- x5*m<y,u+i*4);
x6:=LastValue(Cum((C>=(r+i*5))*(C<(r+i*6))*g1));
ValueWhen(1,f- x6*m<y,u+i*5);
x7:=LastValue(Cum((C>=(r+i*6))*(C<(r+i*7))*g1));
ValueWhen(1,f- x7*m<y,u+i*6);
x8:=LastValue(Cum((C>=(r+i*7))*(C<(r+i*8))*g1));
ValueWhen(1,f- x8*m<y,u+i*7);

x9:=LastValue(Cum((C>=(r+i*8))*(C<(r+i*9))*g1));
ValueWhen(1,f- x9*m<y,u+i*8);
x10:=LastValue(Cum((C>=(r+i*9))*(C<(r+i*10))*g1));
ValueWhen(1,f- x10*m<y,u+i*9);
x11:=LastValue(Cum((C>=(r+i*10))*(C<(r+i*11))*g1));
ValueWhen(1,f- x11*m<y,u+i*10);
x12:=LastValue(Cum((C>=(r+i*11))*(C<(r+i*12))*g1));
ValueWhen(1,f- x12*m<y,u+i*11);

x13:=LastValue(Cum((C>=(r+i*12))*(C<(r+i*13))*g1));
ValueWhen(1,f- x13*m<y,u+i*12);
x14:=LastValue(Cum((C>=(r+i*13))*(C<(r+i*14))*g1));
ValueWhen(1,f- x14*m<y,u+i*13);
x15:=LastValue(Cum((C>=(r+i*14))*(C<(r+i*15))*g1));
ValueWhen(1,f- x15*m<y,u+i*14);
x16:=LastValue(Cum((C>=(r+i*15))*(C<(r+i*16))*g1));
ValueWhen(1,f- x16*m<y,u+i*15);


x17:=LastValue(Cum((C>=(r+i*16))*(C<(r+i*17))*g1));
ValueWhen(1,f- x17*m<y,u+i*16);
x18:=LastValue(Cum((C>=(r+i*17))*(C<(r+i*18))*g1));
ValueWhen(1,f- x18*m<y,u+i*17);
x19:=LastValue(Cum((C>=(r+i*18))*(C<(r+i*19))*g1));
ValueWhen(1,f- x19*m<y,u+i*18);
x20:=LastValue(Cum((C>=(r+i*19))*(C<(r+i*20))*g1));
ValueWhen(1,f- x20*m<y,u+i*19);


x21:=LastValue(Cum((C>=(r+i*20))*(C<(r+i*21))*g1));
ValueWhen(1,f- x21*m<y,u+i*20);
x22:=LastValue(Cum((C>=(r+i*21))*(C<(r+i*22))*g1));
ValueWhen(1,f- x22*m<y,u+i*21);
x23:=LastValue(Cum((C>=(r+i*22))*(C<(r+i*23))*g1));
ValueWhen(1,f- x23*m<y,u+i*22);
x24:=LastValue(Cum((C>=(r+i*23))*(C<(r+i*24))*g1));
ValueWhen(1,f- x24*m<y,u+i*23);


x25:=LastValue(Cum((C>=(r+i*24))*(C<(r+i*25))*g1));
ValueWhen(1,f-Int(x25*m)=y,u+i*24);

x26:=LastValue(Cum((C>=(r+i*25))*(C<(r+i*26))*g1));
ValueWhen(1,f-Int(x26*m)=y,u+i*25);

x27:=LastValue(Cum((C>=(r+i*26))*(C<(r+i*27))*g1));
ValueWhen(1,f-Int(x27*m)=y,u+i*26);

x28:=LastValue(Cum((C>=(r+i*27))*(C<(r+i*28))*g1));
ValueWhen(1,f-Int(x25*m)=y,u+i*27);

x29:=LastValue(Cum((C>=(r+i*28))*(C<(r+i*29))*g1));
ValueWhen(1,f-Int(x29*m)=y,u+i*28);

x30:=LastValue(Cum((C>=(r+i*29))*(C<(r+i*30))*g1));
ValueWhen(1,f-Int(x30*m)=y,u+i*29);


x31:=LastValue(Cum((C>=(r+i*30))*(C<(r+i*31))*g1));
ValueWhen(1,f-Int(x31*m)=y,u+i*30);

x32:=LastValue(Cum((C>=(r+i*31))*(C<(r+i*32))*g1));
ValueWhen(1,f-Int(x32*m)=y,u+i*31);

x33:=LastValue(Cum((C>=(r+i*32))*(C<(r+i*33))*g1));
ValueWhen(1,f-Int(x33*m)=y,u+i*32);

x34:=LastValue(Cum((C>=(r+i*33))*(C<(r+i*34))*g1));
ValueWhen(1,f-Int(x34*m)=y,u+i*33);

x35:=LastValue(Cum((C>=(r+i*34))*(C<(r+i*35))*g1));
ValueWhen(1,f-Int(x35*m)=y,u+i*34);


x36:=LastValue(Cum((C>=(r+i*35))*(C<(r+i*36))*g1));
ValueWhen(1,f- x36*m<y,u+i*35);
x37:=LastValue(Cum((C>=(r+i*36))*(C<(r+i*37))*g1));
ValueWhen(1,f- x37*m<y,u+i*36);
x38:=LastValue(Cum((C>=(r+i*37))*(C<(r+i*38))*g1));
ValueWhen(1,f- x38*m<y,u+i*37);
x39:=LastValue(Cum((C>=(r+i*38))*(C<(r+i*39))*g1));
ValueWhen(1,f- x39*m<y,u+i*38);
x40:=LastValue(Cum((C>=(r+i*39))*(C<(r+i*40))*g1));
ValueWhen(1,f- x40*m<y,u+i*39);
x41:=LastValue(Cum((C>=(r+i*40))*(C<(r+i*41))*g1));
ValueWhen(1,f- x41*m<y,u+i*40);
x42:=LastValue(Cum((C>=(r+i*41))*(C<(r+i*42))*g1));
ValueWhen(1,f- x42*m<y,u+i*41);
x43:=LastValue(Cum((C>=(r+i*42))*(C<(r+i*43))*g1));
ValueWhen(1,f- x43*m<y,u+i*42);
x44:=LastValue(Cum((C>=(r+i*43))*(C<(r+i*44))*g1));
ValueWhen(1,f- x44*m<y,u+i*43);
x45:=LastValue(Cum((C>=(r+i*44))*(C<(r+i*45))*g1));
ValueWhen(1,f- x45*m<y,u+i*44);
x46:=LastValue(Cum((C>=(r+i*45))*(C<(r+i*46))*g1));
ValueWhen(1,f- x46*m<y,u+i*45);
x47:=LastValue(Cum((C>=(r+i*46))*(C<(r+i*47))*g1));
ValueWhen(1,f- x47*m<y,u+i*46);
x48:=LastValue(Cum((C>=(r+i*47))*(C<(r+i*48))*g1));
ValueWhen(1,f- x48*m<y,u+i*47);
x49:=LastValue(Cum((C>=(r+i*48))*(C<(r+i*49))*g1));
ValueWhen(1,f- x49*m<y,u+i*48);
x50:=LastValue(Cum((C>=(r+i*49))*(C<(r+i*50))*g1));
ValueWhen(1,f- x50*m<y,u+i*49);

{Note Two of the above lines needed for 1 line calc in Histograms}
[name=Boundary; color=Black; linestyle=Solid; width=2;]
x51:=(f-d=y)*k;
ValueWhen(1,x51,q);ValueWhen(1,Alert(x51,2),If(x51,q,r));
{c;}



{


x36:=(f-d=y)*k;
ValueWhen(1,x36,q);ValueWhen(1,Alert(x36,2),If(x36,q,r));}
{c;}
{end}

[name=Net Selling; Linestyle=Solid; color=Red; linestyle=Dash; width=3;]
x1a:=LastValue(Cum((C<(r+i))*g2));
ValueWhen(1,f-x1a*m<y,u);
x2a:=LastValue(Cum((C>=(r+i))*(C<(r+i*2))*g2));
ValueWhen(1,f- x2a*m<y,u+i);
x3a:=LastValue(Cum((C>=(r+i*2))*(C<(r+i*3))*g2));
ValueWhen(1,f- x3a*m<y,u+i*2);
x4a:=LastValue(Cum((C>=(r+i*3))*(C<(r+i*4))*g2));
ValueWhen(1,f- x4a*m<y,u+i*3);

x5a:=LastValue(Cum((C>=(r+i*4))*(C<(r+i*5))*g2));
ValueWhen(1,f- x5a*m<y,u+i*4);
x6a:=LastValue(Cum((C>=(r+i*5))*(C<(r+i*6))*g2));
ValueWhen(1,f- x6a*m<y,u+i*5);
x7a:=LastValue(Cum((C>=(r+i*6))*(C<(r+i*7))*g2));
ValueWhen(1,f- x7a*m<y,u+i*6);
x8a:=LastValue(Cum((C>=(r+i*7))*(C<(r+i*8))*g2));
ValueWhen(1,f- x8a*m<y,u+i*7);

x9a:=LastValue(Cum((C>=(r+i*8))*(C<(r+i*9))*g2));
ValueWhen(1,f- x9a*m<y,u+i*8);
x10a:=LastValue(Cum((C>=(r+i*9))*(C<(r+i*10))*g2));
ValueWhen(1,f- x10a*m<y,u+i*9);
x11a:=LastValue(Cum((C>=(r+i*10))*(C<(r+i*11))*g2));
ValueWhen(1,f- x11a*m<y,u+i*10);
x12a:=LastValue(Cum((C>=(r+i*11))*(C<(r+i*12))*g2));
ValueWhen(1,f- x12a*m<y,u+i*11);

x13a:=LastValue(Cum((C>=(r+i*12))*(C<(r+i*13))*g2));
ValueWhen(1,f- x13a*m<y,u+i*12);
x14a:=LastValue(Cum((C>=(r+i*13))*(C<(r+i*14))*g2));
ValueWhen(1,f- x14a*m<y,u+i*13);
x15a:=LastValue(Cum((C>=(r+i*14))*(C<(r+i*15))*g2));
ValueWhen(1,f- x15a*m<y,u+i*14);
x16a:=LastValue(Cum((C>=(r+i*15))*(C<(r+i*16))*g2));
ValueWhen(1,f- x16a*m<y,u+i*15);


x17a:=LastValue(Cum((C>=(r+i*16))*(C<(r+i*17))*g2));
ValueWhen(1,f- x17a*m<y,u+i*16);
x18a:=LastValue(Cum((C>=(r+i*17))*(C<(r+i*18))*g2));
ValueWhen(1,f- x18a*m<y,u+i*17);
x19a:=LastValue(Cum((C>=(r+i*18))*(C<(r+i*19))*g2));
ValueWhen(1,f- x19a*m<y,u+i*18);
x20a:=LastValue(Cum((C>=(r+i*19))*(C<(r+i*20))*g2));
ValueWhen(1,f- x20a*m<y,u+i*19);


x21a:=LastValue(Cum((C>=(r+i*20))*(C<(r+i*21))*g2));
ValueWhen(1,f- x21a*m<y,u+i*20);
x22a:=LastValue(Cum((C>=(r+i*21))*(C<(r+i*22))*g2));
ValueWhen(1,f- x22a*m<y,u+i*21);
x23a:=LastValue(Cum((C>=(r+i*22))*(C<(r+i*23))*g2));
ValueWhen(1,f- x23a*m<y,u+i*22);
x24a:=LastValue(Cum((C>=(r+i*23))*(C<(r+i*24))*g2));
ValueWhen(1,f- x24a*m<y,u+i*23);


x25a:=LastValue(Cum((C>=(r+i*24))*(C<(r+i*25))*g2));
ValueWhen(1,f-Int(x25a*m)=y,u+i*24);
x26a:=LastValue(Cum((C>=(r+i*25))*(C<(r+i*26))*g2));
ValueWhen(1,f- x26a*m<y,u+i*25);
x27a:=LastValue(Cum((C>=(r+i*26))*(C<(r+i*27))*g2));
ValueWhen(1,f- x27a*m<y,u+i*26);
x28a:=LastValue(Cum((C>=(r+i*27))*(C<(r+i*28))*g2));
ValueWhen(1,f- x28a*m<y,u+i*27);
x29a:=LastValue(Cum((C>=(r+i*28))*(C<(r+i*29))*g2));
ValueWhen(1,f- x29a*m<y,u+i*28);
x30a:=LastValue(Cum((C>=(r+i*29))*(C<(r+i*30))*g2));
ValueWhen(1,f- x30a*m<y,u+i*29);
x31a:=LastValue(Cum((C>=(r+i*30))*(C<(r+i*31))*g2));
ValueWhen(1,f- x31a*m<y,u+i*30);
x32a:=LastValue(Cum((C>=(r+i*31))*(C<(r+i*32))*g2));
ValueWhen(1,f- x32a*m<y,u+i*31);
x33a:=LastValue(Cum((C>=(r+i*32))*(C<(r+i*33))*g2));
ValueWhen(1,f- x33a*m<y,u+i*32);
x34a:=LastValue(Cum((C>=(r+i*33))*(C<(r+i*34))*g2));
ValueWhen(1,f- x34a*m<y,u+i*33);
x35a:=LastValue(Cum((C>=(r+i*34))*(C<(r+i*35))*g2));
ValueWhen(1,f- x35a*m<y,u+i*34);
x36a:=LastValue(Cum((C>=(r+i*35))*(C<(r+i*36))*g2));
ValueWhen(1,f- x36a*m<y,u+i*35);
x37a:=LastValue(Cum((C>=(r+i*36))*(C<(r+i*37))*g2));
ValueWhen(1,f- x37a*m<y,u+i*36);
x38a:=LastValue(Cum((C>=(r+i*37))*(C<(r+i*38))*g2));
ValueWhen(1,f- x38a*m<y,u+i*37);
x39a:=LastValue(Cum((C>=(r+i*38))*(C<(r+i*39))*g2));
ValueWhen(1,f- x39a*m<y,u+i*38);
x40a:=LastValue(Cum((C>=(r+i*39))*(C<(r+i*40))*g2));
ValueWhen(1,f- x40a*m<y,u+i*39);
x41a:=LastValue(Cum((C>=(r+i*40))*(C<(r+i*41))*g2));
ValueWhen(1,f- x41a*m<y,u+i*40);
x42a:=LastValue(Cum((C>=(r+i*41))*(C<(r+i*42))*g2));
ValueWhen(1,f- x42a*m<y,u+i*41);
x43a:=LastValue(Cum((C>=(r+i*42))*(C<(r+i*43))*g2));
ValueWhen(1,f- x43a*m<y,u+i*42);
x44a:=LastValue(Cum((C>=(r+i*43))*(C<(r+i*44))*g2));
ValueWhen(1,f- x44a*m<y,u+i*43);
x45a:=LastValue(Cum((C>=(r+i*44))*(C<(r+i*45))*g2));
ValueWhen(1,f- x45a*m<y,u+i*44);
x46a:=LastValue(Cum((C>=(r+i*45))*(C<(r+i*46))*g2));
ValueWhen(1,f- x46a*m<y,u+i*45);
x47a:=LastValue(Cum((C>=(r+i*46))*(C<(r+i*47))*g2));
ValueWhen(1,f- x47a*m<y,u+i*46);
x48a:=LastValue(Cum((C>=(r+i*47))*(C<(r+i*48))*g2));
ValueWhen(1,f- x48a*m<y,u+i*47);
x49a:=LastValue(Cum((C>=(r+i*48))*(C<(r+i*49))*g2));
ValueWhen(1,f- x49a*m<y,u+i*48);
x50a:=LastValue(Cum((C>=(r+i*49))*(C<(r+i*50))*g2));
ValueWhen(1,f- x50a*m<y,u+i*49);


{Note Two of the above lines needed for 1 line calc in Histograms}
[name=Boundary; Linestyle=Solid; Color Black; width =2;]
x51a:=(f-d=y)*k;


-------------
BC User since June 2007


Posted By: paulchow2k
Date Posted: 11 Oct 2013 at 11:14am
Thanks for that.. I'll check the script out... Not sure about price by volume but I'll check the above script out.. is that written in Metastock format?

why do you give metastocktips.com the credit for their idea?

regards

Paul




Posted By: cmacdon
Date Posted: 11 Oct 2013 at 11:55am
Paul

Bullscript is extremely similar but with a few more bells and whistles compared to Metastock indicator code.

Most Metastock indicators will usually port across and run in Bullscript without any or limited tweaking.

Roy Larsen was the originator of the Metastock Price by Volume indicator I originally copied and tweaked in Bullscript. So it is right to give him credit for his original idea and coding effort.

As Gann said everything is but a repetition of the past.

Charles


-------------
BC User since June 2007


Posted By: paulchow2k
Date Posted: 12 Oct 2013 at 2:17pm
Totally agreed with Mr Gann regarding the past. It's NEVER quite the same as the past but the essence is identical. Thanks for your help. Your script certainly does help. I just want to clarify that I WAS obsessed with Market Profile because of what the futures traders were trading. Stocks are a lot less intensive most of the time.

Paul



Print Page | Close Window

Bulletin Board Software by Web Wiz Forums® version 9.69 - http://www.webwizforums.com
Copyright ©2001-2010 Web Wiz - http://www.webwiz.co.uk