Welcome to the Traders Laboratory Forums.
Coding Forum Collaborate, receive help, or discuss coding related issues.

Reply
Old 07-02-2009, 07:01 PM   #1

shrike's Avatar

Join Date: Jun 2009
Location: fantasy
Posts: 85
Ignore this user

Thanks: 44
Thanked 24 Times in 22 Posts



Vwap Hourly

hi
could someone help me to modify the DBVWAP_SD so i can starting it from a prefix hour like 0900 or 1100 , i've tried much times but nothing
shrike is offline  
Reply With Quote
Old 07-02-2009, 08:38 PM   #2

Tams's Avatar

Join Date: Sep 2008
Location: Geelong
Posts: 3,575
Ignore this user

Thanks: 2,020
Thanked 1,398 Times in 858 Posts



Re: Vwap Hourly

Look for the following code inside the indicator

if date > date[1] then begin


The software evaluates each bar one at a time.
When it reaches a bar that has a different date than the previous bar,
it knows that a new day has begun... and resets the data.


you can change the line to the following:

if time = 0900 then begin

This will do the reset at 0900.




.

Last edited by Tams; 07-02-2009 at 08:44 PM.
Tams is offline  
Reply With Quote
Old 07-03-2009, 04:00 AM   #3

shrike's Avatar

Join Date: Jun 2009
Location: fantasy
Posts: 85
Ignore this user

Thanks: 44
Thanked 24 Times in 22 Posts



Re: Vwap Hourly

hi
thanks Tams for help , i tried it and work but what i found sometime an error because if i plot it on a range or volume chart sometime where is not a candle at 0900 so or return an error or skip restart when find a candle at 0900 . i try this :
if time = iniz or time =iniz+1 or time =iniz+2 or time =iniz+3 or time =iniz+4 or time =iniz+5 then begin . not elegant but must study more language code

i 've seen one post where you explain a formula with begin_time and end_time , i tried to insert in the code but dont work
shrike is offline  
Reply With Quote
Old 07-03-2009, 05:10 AM   #4

BlowFish's Avatar

Join Date: Mar 2007
Location: In Da House
Posts: 3,272
Ignore this user

Thanks: 129
Thanked 1,038 Times in 694 Posts



Re: Vwap Hourly

Try something like.....

inputs:
iStartTime (0800),
ResetMinutes (60);


if mod( (TimeToMinutes(time)-TimeToMinutes(iStartTime) ), TimeToMinutes(ResetMinute s) ) = 0 then
begin
reset code starts here
BlowFish is offline  
Reply With Quote
Old 07-03-2009, 03:00 PM   #5

shrike's Avatar

Join Date: Jun 2009
Location: fantasy
Posts: 85
Ignore this user

Thanks: 44
Thanked 24 Times in 22 Posts



Re: Vwap Hourly

thanks BlowFish
make some attempts, what do you mean with reset code starts here

maybe replace : if date > date[1] then begin

with

if mod( (TimeToMinutes(time)-TimeToMinutes(iStartTime) ), TimeToMinutes(ResetMinute s) ) = 0 then
begin
shrike is offline  
Reply With Quote
Old 07-03-2009, 06:08 PM   #6

BlowFish's Avatar

Join Date: Mar 2007
Location: In Da House
Posts: 3,272
Ignore this user

Thanks: 129
Thanked 1,038 Times in 694 Posts



Re: Vwap Hourly

Yes, thats pretty much it.
You need the two inputs also.
BlowFish is offline  
Reply With Quote
Old 07-04-2009, 10:11 AM   #7

Join Date: Jan 2008
Location: San Francisco
Posts: 394
Ignore this user

Thanks: 17
Thanked 338 Times in 156 Posts



Re: Vwap Hourly

one logical way to do this is to create a variable that will store the count for the number of bars since a given time or date.

vars: firstbar(0), length(0);

if date > date[1] then begin
firstbar=currentbar;
end;

length=currentbar-firstbar;

--------------------------------------

the above creates a variable called 'firstbar' and stores that information of when the firstbar began so that you can reference it with a second variable 'length'. length is then a changing variable that is the difference between the bar you are on and the first bar of the day. so the code 'average(close,length);' ..... is the simple average close since the day began, counting back more as the number of bars increases. I found this little piece of code very logical.
Frank is offline  
Reply With Quote
Old 07-06-2009, 07:00 AM   #8

BlowFish's Avatar

Join Date: Mar 2007
Location: In Da House
Posts: 3,272
Ignore this user

Thanks: 129
Thanked 1,038 Times in 694 Posts



Re: Vwap Hourly

The advantage of the code I posted is that it allows you to specify any start time and any period (in minutes) to perform the reset. This is irrespective of bar type or size. It works too as I use it in my studies
BlowFish is offline  
Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Vwap trader273 Open E Cry 4 09-08-2010 07:48 AM
Vwap conr Technical Analysis 4 04-25-2009 10:56 AM
Help for SC Indicators VWAP & VWAP Bands Trendup_ Market Profile 3 11-29-2008 11:00 AM
Help for SC Indicators VWAP & VWAP Bands Trendup_ Market Analysis 0 09-20-2008 11:14 PM
IRT and VWAP dupaski Market Profile 2 02-05-2008 04:22 PM

All times are GMT -4. The time now is 08:28 AM.
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
CS to VB integration by DeskLancer
©2006-2011 Traders Laboratory, All Rights Reserved.