Multi timeframe – MTF indicators for ProRealTime
06/28/2020 at 9:51 AM #137347
Seems to be capricious…
Sometimes it works, sometimes not. You need to update the graph..Some problem with codes, seems to be impossible to add the same indicator with 2 timeframes…1234timeframe(5 minutes, updateonclose)ind=average[p,t](close)return ind06/28/2020 at 10:03 AM #13735006/28/2020 at 12:57 PM #13739106/30/2020 at 2:38 PM #137719
There is great potential in MTF for ProBuilder, but this functionality still seems to suffer from youthful flaws.
An indicator using MTF for ProBuilder is very good at processing historical data. But if we want to use it as a dynamic indicator, i.e. for data updated in real time, this indicator runs out of steam quickly, in the sense that the data no longer updates and a past result repeats itself (seconds after seconds, minutes after minutes depending on the time unit used) without updating.
To illustrate this behavior with a readily available example, let’s take a 3 second SMI on a 1 second chart. The use of the background color will highlight the non-updating of the data.
On both attachments, the top graph -the “test” graph”- shows the SMI 3s on a 1s graph, the bottom graph -the control graph- shows the SMI 3s on a 3s graph.
First attachment. The white vertical line on the left corresponds to the start of our test (a first refresh of the top graph).
The double vertical line on the right was placed just before a second manual refresh of the graph. We see a uniform red range between the vertical bars
The 2nd attachment presents the situation after the second manual refresh of the test graph: we see that the data between the vertical lines has been updated. There is a minor difference between the update and the control graph, this is probably due to some flaw in the code, but the demonstration here concerns the non-updating in real time of the data from a ProBuilder indicator using MTF.3s SMI on 1s graph using MTF1234567891011121314151617181920212223242526272829303132// code for the "test" graphtimeframe(3 seconds, updateonclose)smi3s = SMI[14,3,5](close)smi3s1 = smi3stimeframe(1 second, updateonclose)if smi3s > smi3s1 thenbackgroundcolor(0,255,0,110)elsebackgroundcolor(255,0,0,110)endifreturn// code for the reference graphsmi3s = SMI[14,3,5](close)if smi3s > smi3s thenbackgroundcolor(0,255,0,110)elsebackgroundcolor(255,0,0,110)endifreturn06/30/2020 at 2:48 PM #13772906/30/2020 at 11:53 PM #137835
Regarding the “mode”, I read your instructions in the Topic “Première approche sur le multi timeframe avec ProRealTime”.
I tried using updateonclose, default, even no mention of mode with the lowest -default- timeframe. Then I made all the tests that I could imagine to try to isolate the condition of occurrence of the end of the updating of the data, while taking care that the material conditions were “optimal” on my side. The tests were carried out on the ETF “SPY” data, i.e. with a much bigger data flow than with the previous example (FP)
Either after opening the workspace or refreshing the graph, in all cases, the updating stopped to occur, but this time very randomly : sometimes after 12 seconds, sometimes after more than 4 minutes; sometimes after 2 data updates (change from green to red or vice versa), sometimes after about fifteen updates. In short, I did not manage to isolate a condition of occurrence, or to know if it is a problem of data supply or local. May be have à try if you or someone around you have the time to do it ; I admit it’s rather vague as a symptom.07/05/2020 at 12:15 PM #138453
I have started playing around with probuilder tonight using the mtf’s.
What I am trying to do is to display a 5 period monthly moving average on a daily chart. It does display but there is a few issues with it. The idea is to give me a longer trend direction so I trade with the larger timeframe.
- The indicator displays in its own box instead of in the main window. Not a big thing but was just different to what I expected to happen.
- I have coded the indicator to go green on up months and red on down months but it is displaying a daily change instead of the month trend. I am not sure if I can change this to display the monthly instead of the daily.
Obviously as the time in the month progresses the final reading will change as the price changes. I would have expected a slow changing line (something like a 105 period line) but it is quite jagged. Is the code I am using too simple? If I use the update on close it tends to be a stair type movement. It doesn’t change for the whole month and then it steps dramatically.
The code that I used:
a = Average (close)
return A07/05/2020 at 12:53 PM #138456
To show it on the price chart you need to click the spanner on the upper left corner of your chart, then select the indicator you want to add.
To use different colours:1234567891011timeframe(1 month)r = 0g = 128b = 0t = 255a = Average[5,0](close)If a < a thenr = 255g = 0Endifreturn a Coloured(r,g,b,t) as “AvgM”
1 user thanked author for this post.07/05/2020 at 1:08 PM #13845807/07/2020 at 9:23 AM #138612
SMI doesn’t seem to work with MTF
Any hints to fix the issue ?
ThanksSMI with MTF1234567timeframe(2 seconds, updateonclose)smi2s = SMI[14,3,5](close)timeframe(1 second)smi1s = SMI[14,3,5](close)return smi2s coloured(255,255,0), smi1s coloured(51,204,255)07/07/2020 at 12:51 PM #13863207/07/2020 at 4:33 PM #13865707/22/2020 at 12:15 PM #139829
DEFPARAM CalculateOnLastBars = 200 appears to be ignored when used with multi timeframe code. This may be by design due to the multi timeframe calculations? Just wanted to check.
Sample code.CalculateOnLastBars ignored with multi timframe1234567DEFPARAM CalculateOnLastBars = 200TIMEFRAME(1 Hour)Test = ExponentialAverage(close)RETURN Test
Rob07/22/2020 at 12:30 PM #139835