Thanks for being patient.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Daily WMA
Collapse
X
-
I know you guys are correct but just need to figure out. back tomorrow.
Thanks for being patient.
-
I think we're getting there ...
"The last historical value on the daily chart was calculated on the daily chart, so querying its value today will return the value on the daily chart, calculated at the close of yesterday."
does this mean that if yesterdays close on the daily chart was 1.35 then Closes[1][0] = 1.35 (so you cannot reference the last (incomplete) close of the last daily bar?)
also does this mean that if the day before yesterdays close on the daily chart was 1.34 then Closes[1][1] = 1.34?
I'll re-check tomorrow but I think Print output matched the values on the daily chart.
"Any intraday historical bar would be a bar calculated today"
does this mean that if the last (incomplete) close on the intraday chart was 1.36 then Closes[1][0] = 1.36?
Thanks again.Last edited by futurenets; 02-16-2015, 04:33 PM.
Comment
-
Actually, given how you have it coded, I may have misled you. You are calculating everything from the same indicator, and you do have CalculateOnBarClose = false;. That means that all calculations will, in fact, be up to the moment. So Close[1][0] should match Close[0][0] at all times, as they are being read from the same equity.Originally posted by futurenets View PostI think we're getting there ...
"The last historical value on the daily chart was calculated on the daily chart, so querying its value today will return the value on the daily chart, calculated at the close of yesterday."
does this mean that if yesterdays close on the daily chart was 1.35 then Closes[1][0] = 1.35 (so you cannot reference the last (incomplete) close of the last daily bar?)
also does this mean that if the day before yesterdays close on the daily chart was 1.34 then Closes[1][1] = 1.34?
I'll re-check tomorrow but I think Print output matched the values on the daily chart.
"Any intraday historical bar would be a bar calculated today"
...
Thanks again.
As COBC = false, yesterday's close will actually be Close[1][1] and so on.
My apologies. Next time, I shall read more carefully before responding, and not just assume, from a speed read glance, that I know what is being asked.
Actually, your intraday chart is the parent timeframe, so is indexed as "0". That means that the most current last price is Close[0][0]. Which should match Close[1][0], per my explanation above. It so happens that these values are the same, but it is still best practice to refer to the correct datum, even if it matches another datum.does this mean that if the last (incomplete) close on the intraday chart was 1.36 then Closes[1][0] = 1.36?
Comment
-
ok thanks again. I know you're busy and I appreciate this effort to help me understand.
sorry but now I'm not sure why DailyWMA is one day out when compared with WMA?
(when I don't set "WMADaily.Set(dailyWMA1)" in BarsInProgress 1)Last edited by futurenets; 02-17-2015, 01:44 AM.
Comment
-
I'm in need of some details of what is actually happening.
The intraday switches to a new day at 18:30 (UK Time) on the current day and 22:00 all others.
... not one of the easiest solutions to plotting daily data on intraday charts?
Comment
-
Hello futurenets,
Thank you for your response.
You will need to match your intra-bar series Session Template (right click in chart > Data Series > Session Template) to the proper hours used for the Daily bars from your provider. For information on Session Templates please visit the following link: http://www.ninjatrader.com/support/h...on_manager.htm
Comment
-
ok thanks Patrick
currently set on "Use Instrument Settings" so can I check what these are for EURUSD? If this falls into "Forex" category (see attached) then a new day should start at 17:00 (22:00 in UK) which is what happens when loading historical data.
Yesterday the intraday switched to a new day at 18:30 (17Feb UK real-time) this morning it's now 22:00 (17Feb) - will try again this evening using Forex Session and see what happens in real-time.
We've been discussing this for a while now and, while I appreciate all your help, so far I have absolutely no idea what's happening?
This is a great product but should I reach the conclusion that mixing daily bar objects with intraday bar objects is not a good idea in NT7? If so I can find other ways round this problem.
Or perhaps you have a working solution that combines daily & intra-day bar objects?Last edited by futurenets; 02-18-2015, 07:35 AM.
Comment
-
ok thanks Patrick
using FXCM data (set session to Forex in NT) and watching/waiting for new day.
yesterday that started at real-time at 16:30 (UK Time) 17Feb
this morning when I looked historically it started at 22:00 (UK Time) 17Feb
so not sure what happening.
My only concern is there are no working samples of daily bar objects working alongside intraday bar objects and we can't go on discussing this indefinately.Last edited by futurenets; 02-18-2015, 09:50 AM.
Comment
-
Hello futurenets,
Please try the code below instead, this code works perfectly to show the daily value of the WMA for a 5 period on a minute chart with 365 days to load:
Code:protected override void Initialize() { Add(new Plot(Color.Gray, "plot")); Add(PeriodType.Day, 1); } /// <summary> /// Called on each bar update event (incoming tick) /// </summary> protected override void OnBarUpdate() { if(CurrentBars[0] <= 5 || CurrentBars[1] <= 5) return; Value.Set(WMA(BarsArray[1], 5)[0]); } public override string FormatPriceMarker(double price) { // Formats price values to 4 decimal places return price.ToString("N4"); }
Comment
-
thank you very much Patrick, starting to come together. Sorry it took me so long and thank you for your patience.Last edited by futurenets; 02-19-2015, 02:53 AM.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
599 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
345 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
103 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
558 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
558 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment