VWAP indicator for NASDAQ Future NQ?
Forums › ProRealTime English forum › ProBuilder support › VWAP indicator for NASDAQ Future NQ?
- This topic has 12 replies, 4 voices, and was last updated 11 months ago by robertogozzi.
-
-
11/13/2023 at 11:59 PM #223680
Hello everyone,
I’m posting this message to ask for help. I’m looking to create an indicator returning me the daily VWAP value dedicated to NASDAQ Future (NQ), starting at the specific opening time of this Future ( 5:00 p.m. – 6:00 p.m. ET (4:00 p.m. – 5:00 p.m. CT)).
I have searched and found the sources for intraday VWAP for classic stock, which works perfectly, but I have failed to adapt it to the opening time of this Future.
Thank you in advance for your help!
11/14/2023 at 9:15 PM #223710Hi @ropika33
Try this…
(adjust the start and end time to your choice)VWAP StartTime123456789101112131415161718SessionStart=050000SessionEnd=220000If Time=SessionStart thenxStartBar=BarIndexEndIfIf Time>=SessionStart and Time=<SessionEnd thenN=(BarIndex+1)-xStartBarVW = Close * VolumeVolumeSum = Summation[N](Volume)VolumeWeightedSum = Summation[N](VW)VWAP = VolumeWeightedSum / VolumeSumElseVWAP=CloseEndIfReturn VWAP Coloured("Red")11/17/2023 at 5:51 AM #223854Thank you JS.
However I failed to obtain a correct result. I changed the time (5:00 p.m. – 6:00 p.m. ET):
SessionStart=180000
SessionEnd=170000
The obtained curve simply links the close prices of each candle between them…
Any idea?
11/17/2023 at 9:29 AM #22386011/25/2023 at 2:18 AM #224277Excuse for my late answer. As explained in the original message, the NQ FUTURE trading time is this one: 5:00 p.m. – 6:00 p.m. ET (4:00 p.m. – 5:00 p.m. CT).
For instance: Opening time: 5pm on Monday / Closing time (23 hours later): 4pm on Tuesday.
I don’t decide. It is simply the official time to trade NQ Future.
11/26/2023 at 4:25 AM #224302Hello ropika33,
You can keep on writing the same time-confusing posts in each of the topic you open about the same subject, but …
It does not work out like this. 😉Your country flag tells you reside in France. Well, then you must be able to think France times, right ?
So that assumed (but I am not so sure about your indicated location) it works like this – at least for the communication in this forum :The NQ futures opens at 00:00. They close at 23:00 (and settle at 22:00). There is really nothing more to it.
You can code these times literally so in your programs codes.If you are with IBKR (PRT-IB) then there is no need to obtain the times in de program code because there won’t be any bar data between 23:00 and 22:00 – Volume data will stay in-tact IMO.
If you re with IG (PRT-IG) then it could be different because IG also trades outside of regular future hours, but you would like to omit volume data between 23:00 and 00:00 because it will be worthless for volume data. This makes volume data math “awkward”.If you reside in the USA then the communication as such is more difficult because over here we don’t think in ET or CET and we won’t be able to translate that intuitively to our times. But if you really need to because you reside in the USA and you yourself can’t think in our times, use ONE time reference only. The accepted one would be the one where in our time (Paris, Amsterdam) future opening times are 00:00. This would make it logical to mention your USA time 6 hours earlier (this is just Exchange opening time stuff). Nobody (for program code) would care whether this is ET or CET, as long as we (you !) know that this would be 18:00 = 6pm. Thus, Future open on Sunday at 6pm. They close 23 hours later on Monday = 5pm.
None of these times appear in all of your topics (I think 4 by now) which should incur for the conclusion that you reside just in France after all, but think that you must convert to USA times which could be difficult. But this is not necessary at all.Thus again, when you reside in France, then in Paris time NQ futures open at 00:00 and close at 23:00. This is so for Monday, Tuesday, Wednesday, Thursday and Friday. Exceptions are there for, for example, the past Thursday and Friday (Nov. 23 and 24 – Thanksgiving), when NQ futures closed at 19:00 and 19:15 respectively.
Talking (communicating) like this, assumes that you use have set to use your local time in the PRT platform and not the time of the instruments. This is important.I hope this helps you !
Peter11/26/2023 at 4:34 AM #224303Hello PeterSt,
I live in the USA (French American), New Mexico.
4:00 p.m. – 5:00 p.m. CT is the Chicago CME market time (Futures market).
I gave the two times (CT (Chicago) and ET (New York)) at the beginning of this thread because they are the times of the country where I live 😉
Do you have any advice about the resolution of my issue?
11/26/2023 at 11:57 AM #224307So being in New Mexico you obviously need the USA related times, because using European times would be awkward for you just the same.
It comes down to this part, I think :
The accepted one would be the one where in our time (Paris, Amsterdam) future opening times are 00:00. This would make it logical to mention your USA time 6 hours earlier (this is just Exchange opening time stuff). Nobody (for program code) would care whether this is ET or CET, as long as we (you !) know that this would be 18:00 = 6pm.
What this requires is a setting which matches the opening of the futures of 6pm. The difficulty for me is to bring across what this would be for you in New Mexico. Example :
If all is right, you are not subject to Daylight Savings. However, the “Exchange” normalized times, are. Exchange won’t be the proper wording (because it would lead to e.g. Chicago), and it is better to refer to the NY time. Thus, whatever that is for you for a setting, it is the New York time you need, and that concurs with the 6pm opening (and 5pm closing).But
Sadly, NY *is* subject to Daylight Savings and since 3 weeks or so it is “Winter Time” there (the normal time). This will mean that when Summer Time starts in 2024 (Sunday March 10), the opening of the futures will be one hour earlier for you, thus 5pm (closing at 4pm). This will last the whole summer.
Disclaimer : We have more often discussions about this variances in time, but this one I don’t recall; it is special because your Mountain Time Zone (if I am correct) does not have Daylight Saving. The specialty is that in my code (for Netherlands) I have an offset for 1 or 2 (or maybe 3) weeks because of the difference in Daylight Saving start and end, while with you it would last the whole summer.
Maybe others have ideas, but I would not know a solution for how to code this, because it is too easy to make mistakes. We, over here, are not from the CET etc. times, and we also don’t know a thing about the differences between States. I do know that when you travel 4 states, you need to adjust your wristwatch 4 times, because each state tends to have another time. This is not about Daylight Savings (the change of an hour is the same for the USA throughout (except thus the Mountain Time zone), but the individual times are different (and vary for IIRC 3 hours maximum).
And so all I can refer to is the NY time (how ever that is denoted), because I (or we) know the difference with that for us over here : 6 hours (yeah, or 5 hours when we are in the twilight zone of Daylight Savings difference – which happens twice a year).This is all so stupidly vague for at least me, that “guessing” when the FED will speak / announce new rates, is always a hit and miss because it is not expressed in NY time, but another; maybe other PRT users know definitely in advance whether that is 7pm or 8pm for us, not forgetting about said twilight zone which also may occur coincidentally.
There seems to be a solution in the PRT settings with the hint of “Use Instrument times” after all. But the second hint would be that nobody knows how to set those – at least I don’t as it would be unworkable for me. I would get crazy of all the different times to set in the code, and so I don’t. I use two “variables” only : 1. the knowledge of the “exchange” times, and 2. the incorporation of the Daylight Savings difference.
Ad 1.: For Europe, USA and UK only; would I (Auto-) trade Asian countries as well, I’d probably find a high bridge (not looking at India because that is even more special).
It takes years to grasp all this, I my years seem not to be sufficient yet.Hopefully others have good hints for you; people from Australia (or New Zealand for that matter) deal with very similar but in other dimensions (like reversed Daylight Savings compared to USA / Europe).
BZZzzzz
11/26/2023 at 12:12 PM #224308Question :
4:00 p.m. – 5:00 p.m. CT is the Chicago CME market time (Futures market).
Why do you often mention such time sequences which seem wrong to me ?
You seem to tell that the opening times are 25 hours long, which obviously is not so. Thus, I think you should say “5:00 pm – 4:00 pm” or possibly 6:00 pm – 5:00 pm) because that is 23 hours of length.N.b.: Why do I like to refer to NY time ? because the news (or Bloomberg) is always referring to that time. “08:30 New Job Openings” etc. These News times are absolute – and don’t ask me why it is not referring to the real exchange time (Chicago) – probably because that is only one exchange (Futures) while more exist – so someone picked one for the standard ?).
In other words : all we see over here is references to NY times, so it would be best if you communicate those times as well. Otherwise it is too difficult for us, Europe based poor blokes.
Example below.11/26/2023 at 4:31 PM #224319That’s a long answer for someone who claims to be incompetent on the subject. I already know all that. I’m just looking for the TECHNICAL ANSWER. PRT’s VWAP base indicator starts at the right time for the NQ Future quote. So it’s possible. I’m just looking for the code of this indicator allowing me to do a backtest with the returned VWAP value. That’s all I’m looking for.
11/26/2023 at 9:56 PM #224336Do not double post. Ask your question only once and only in one forum. All double posts will be deleted anyway so posting the same question multiple times will just be wasting your own time and will not get you an answer any quicker. Double posting just creates confusion in the forums
Thanks 🙂
I have locked the other two posts of yours.
11/26/2023 at 10:11 PM #22433812/26/2023 at 11:31 AM #225702This is JS‘s version modified to also accomodate for starting time > ending time:
123456789101112131415161718192021222324252627282930SessionStart = 180000SessionEnd = 170000If Time=SessionStart thenxStartBar=BarIndexEndIfIF SessionEnd > SessionStart THENIf Time>=SessionStart and Time=<SessionEnd thenN=(BarIndex+1)-xStartBarVW = Close * VolumeVolumeSum = Summation[N](Volume)VolumeWeightedSum = Summation[N](VW)VWAP = VolumeWeightedSum / VolumeSumElseVWAP=CloseEndIfELSEIf Time>=SessionStart or Time=<SessionEnd thenN=(BarIndex+1)-xStartBarVW = Close * VolumeVolumeSum = Summation[N](Volume)VolumeWeightedSum = Summation[N](VW)VWAP = VolumeWeightedSum / VolumeSumElseVWAP=CloseEndIfENDIFReturn VWAP Coloured("Red") -
AuthorPosts
Find exclusive trading pro-tools on