Coding Forum Thread, Vwap Hourly in Trading Resources; hi
could someone help me to modify the DBVWAP_SD so i can starting it from a prefix hour like 0900 ...  | | | | 
07-02-2009, 06:01 PM
| | | | Join Date: Jun 2009 Location: fantasy
Posts: 84
Thanks: 40
Thanked 24 Times in 22 Posts
| | 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  | 
07-02-2009, 07:38 PM
| | | | Join Date: Sep 2008 Location: Geelong
Posts: 2,279
Thanks: 1,282
Thanked 972 Times in 575 Posts
| | 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 07:44 PM.
| 
07-03-2009, 03:00 AM
| | | | Join Date: Jun 2009 Location: fantasy
Posts: 84
Thanks: 40
Thanked 24 Times in 22 Posts
| | 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 | 
07-03-2009, 04:10 AM
| | | | Join Date: Mar 2007 Location: In Da House
Posts: 2,840
Thanks: 108
Thanked 822 Times in 562 Posts
| | Try something like.....
inputs:
iStartTime (0800),
ResetMinutes (60);
if mod( (TimeToMinutes(time)-TimeToMinutes(iStartTime) ), TimeToMinutes(ResetMinute s) ) = 0 then
begin
reset code starts here | 
07-03-2009, 02:00 PM
| | | | Join Date: Jun 2009 Location: fantasy
Posts: 84
Thanks: 40
Thanked 24 Times in 22 Posts
| | 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 | 
07-03-2009, 05:08 PM
| | | | Join Date: Mar 2007 Location: In Da House
Posts: 2,840
Thanks: 108
Thanked 822 Times in 562 Posts
| | Yes, thats pretty much it.
You need the two inputs also. | 
07-04-2009, 09:11 AM
| | | | Join Date: Jan 2008 Location: San Francisco
Posts: 394
Thanks: 17
Thanked 332 Times in 156 Posts
| | 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. | 
07-06-2009, 06:00 AM
| | | | Join Date: Mar 2007 Location: In Da House
Posts: 2,840
Thanks: 108
Thanked 822 Times in 562 Posts
| | 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  | 
07-06-2009, 06:12 AM
| | | | Join Date: Mar 2007 Location: In Da House
Posts: 2,840
Thanks: 108
Thanked 822 Times in 562 Posts
| | Here's a 50 contract constant volume chart with resets every hour. | | The Following 2 Users Say Thank You to BlowFish For This Useful Post: | | 
07-08-2009, 09:06 AM
| | | | Join Date: Jun 2009 Location: fantasy
Posts: 84
Thanks: 40
Thanked 24 Times in 22 Posts
| | hi
thanks to everyone , i'm working on your advice |  | | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | | | | Thread Tools | | | | Display Modes | Linear Mode |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | | |