Multiple Timeframes support available?
Forums › ProRealTime English forum › ProRealTime platform support › Multiple Timeframes support available?
- This topic has 29 replies, 6 voices, and was last updated 5 years ago by ginko.
-
-
01/30/2018 at 12:10 PM #60959
Can anyone tell me if 10.3 now supports multiple timeframes so i can a signal from a 15minute chart can allow me to sell a share on an hourly chart.
Many thanks
01/30/2018 at 1:26 PM #60972Still not available right now, but this feature will be added this year for IG/PRT-CFD customers, just right after the new engine (which is already available with a prorealtime trading with IB or prorealtime software account).
1 user thanked author for this post.
04/25/2018 at 9:44 AM #6912310/08/2019 at 10:35 AM #109598I have seen this first implementation on auto-trading (that is not available on every broker using PRT) : https://www.prorealcode.com/blog/learning/approach-multi-timeframe-trading-prorealtime/
Any insights to create indicators using mutiple timeframes on the same chart ?
10/08/2019 at 10:59 AM #109604ProBuilder does not support MTF at present, thus making it impossible to build MTF indicators/oscillators.
MTF Indicators can be simulated by running a piece of code as a strategy in ProBackTest and using GRAPHONPRICE to plot it on the chart. You’ll have to keep your backtest window open at all time, though.
Example: https://www.prorealcode.com/documentation/graphonprice/
10/08/2019 at 11:01 AM #109605Any insights to create indicators using mutiple timeframes on the same chart ?
MTF is not available for indicators yet. It is only available for ProOrder strategies and ProScreener.
You can however create some MTF indicators by coding a dummy strategy and using GRAPH or GRAPHONPRICE. Something like this:
12345678910timeframe(weekly, updateonclose)a = average[52]timeframe(daily, default)b = average[200]buy at -close limitgraphonprice agraphonprice b10/08/2019 at 11:03 AM #10960610/09/2019 at 11:54 AM #109717Thanks for the ansewer that looks great in general.
In my case, I tried, but my timeframe is in ticks in the indcator, it seems like I cannot combine it with a time view, like 1 hour.
I would like to get values at specific times, let’s say each 15 minutes on a 200 ticks chatr on dow
I used the folloing code to retrieve Close by hand, but I was wondering wheter
Q1/ There would be a better way to build the (closeTime0 to closeTime4) simulated array, like using a real array, I may need more values and I would like to use indicators on those. I can go from scratch, but it would be really tedious without arrays (no for, while, and so on)
Q2/ I see it works only with Time and CurrentTime is never updated (i.e: if I use “IF CTM >= FutTime AND CT<220000 Then” in the code below instead of “IF CT >= FutTime AND CT<220000 Then”), is this or documented somewhere or a defect ?
Sample code I made to debug the issue:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354ONCE FutTime=40000ONCE s=5*pipsizeCH=HourCM=MinuteCMC=CurrentMinuteCloseTime0=CloseCT=TimeCTC=CurrentTimeBI=barindexY=highDRAWTEXT(“FutTime: #FutTime#” , BI, Y+14*s)DRAWTEXT(“Time: #CT#” , BI, Y+12*s)DRAWTEXT(“Current time: #CTC#” , BI, Y+11*s)DRAWTEXT(“Minute: #CM#” , BI, Y+9*s)DRAWTEXT(“Current minute: #CMC#” , BI, Y+8*s)DRAWTEXT(“Close0: #closeTime0#” , BI, Y+6*s)DRAWTEXT(“Close1: #closeTime1#” , BI, Y+5*s)DRAWTEXT(“Close2: #closeTime2#” , BI, Y+4*s)DRAWTEXT(“Close3: #closeTime3#” , BI, Y+3*s)DRAWTEXT(“Close4: #closeTime4#” , BI, Y+2*s)DRAWTEXT(“Nb hits: #CountMM5M15#” , BI, Y+1*s)IF CT >= FutTime AND CT<220000 Thenclosetime4=closeTime3closeTime3=closeTime2closeTime2=closeTime1closeTime1=closeTime0CountMM5M15=CountMM5M15+1Y=closes=-sDRAWTEXT(“FutTime: #FutTime#” , BI, Y+14*s)DRAWTEXT(“Time: #CT#” , BI, Y+12*s)DRAWTEXT(“Current time: #CTC#” , BI, Y+11*s)DRAWTEXT(“Minute: #CM#” , BI, Y+9*s)DRAWTEXT(“Current minute: #CMC#” , BI, Y+8*s)DRAWTEXT(“Close0: #closeTime0#” , BI, Y+6*s)DRAWTEXT(“Close1: #closeTime1#” , BI, Y+5*s)DRAWTEXT(“Close2: #closeTime2#” , BI, Y+4*s)DRAWTEXT(“Close3: #closeTime3#” , BI, Y+3*s)DRAWTEXT(“Close4: #closeTime4#” , BI, Y+2*s)DRAWTEXT(“Nb hits: #CountMM5M15#” , BI, Y+1*s)s=-sIF CM < 45 thenFutTime=CH*10000+(ROUND(CM/15)+1)*1500ELSEFutTime=(CH+1)*10000DRAWVLINE(barindex) coloured (0,0,128) // test to see whether the test works: should draw a vertical line each hourIF FutTime > 210000 thenFutTime= 040000 // make sure we do not collect value between 21:00:00 and 4:00:00 (fixed timings depending on local TZ)CountMM5M15=0ENDIFENDIFENDIFReturnAny suggestions or insights for Q1 and Q2 ?
Thanks for your help
10/09/2019 at 2:54 PM #109742>> For clarity of messages on ProRealCode’s forums, please use the “insert code PRT” button to separate the text of the code part! Thank you! <<
10/09/2019 at 3:31 PM #109745This is the code showing the issue for Q1 above (in my previous post)
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354ONCE FutTime=40000ONCE s=5*pipsizeCH=HourCM=MinuteCMC=CurrentMinuteCloseTime0=CloseCT=TimeCTC=CurrentTimeBI=barindexY=highDRAWTEXT(“FutTime: #FutTime#” , BI, Y+14*s)DRAWTEXT(“Time: #CT#” , BI, Y+12*s)DRAWTEXT(“Current time: #CTC#” , BI, Y+11*s)DRAWTEXT(“Minute: #CM#” , BI, Y+9*s)DRAWTEXT(“Current minute: #CMC#” , BI, Y+8*s)DRAWTEXT(“Close0: #closeTime0#” , BI, Y+6*s)DRAWTEXT(“Close1: #closeTime1#” , BI, Y+5*s)DRAWTEXT(“Close2: #closeTime2#” , BI, Y+4*s)DRAWTEXT(“Close3: #closeTime3#” , BI, Y+3*s)DRAWTEXT(“Close4: #closeTime4#” , BI, Y+2*s)DRAWTEXT(“Nb hits: #CountMM5M15#” , BI, Y+1*s)IF CT >= FutTime AND CT<220000 Thenclosetime4=closeTime3closeTime3=closeTime2closeTime2=closeTime1closeTime1=closeTime0CountMM5M15=CountMM5M15+1Y=closes=-sDRAWTEXT(“FutTime: #FutTime#” , BI, Y+14*s)DRAWTEXT(“Time: #CT#” , BI, Y+12*s)DRAWTEXT(“Current time: #CTC#” , BI, Y+11*s)DRAWTEXT(“Minute: #CM#” , BI, Y+9*s)DRAWTEXT(“Current minute: #CMC#” , BI, Y+8*s)DRAWTEXT(“Close0: #closeTime0#” , BI, Y+6*s)DRAWTEXT(“Close1: #closeTime1#” , BI, Y+5*s)DRAWTEXT(“Close2: #closeTime2#” , BI, Y+4*s)DRAWTEXT(“Close3: #closeTime3#” , BI, Y+3*s)DRAWTEXT(“Close4: #closeTime4#” , BI, Y+2*s)DRAWTEXT(“Nb hits: #CountMM5M15#” , BI, Y+1*s)s=-sIF CM < 45 thenFutTime=CH*10000+(ROUND(CM/15)+1)*1500ELSEFutTime=(CH+1)*10000DRAWVLINE(barindex) coloured (0,0,128) // test to see whether the test works: should draw a vertical line each hourIF FutTime > 210000 thenFutTime= 040000 // make sure we do not collect value between 21:00:00 and 4:00:00 (fixed timings depending on local TZ)CountMM5M15=0ENDIFENDIFENDIFReturnAdditionally a very simple case showing the issue for Q2 on a tick graph (let’s say 100 ticks on Dow)
simple case for Q2 above1234567891011//To be run on a 100 unit & 100 Tick Dow graphDEFPARAM DRAWONLASTBARONLY = TRUEONCE s=5*pipsizeCTC=CurrentTimeCT=TimeBI=barindexY=highDRAWTEXT("Time: #CT#" , BI, Y+2*s)DRAWTEXT("Current time: #CTC#" , BI, Y+1*s)Return10/10/2019 at 12:27 AM #109772This will plot TIME & PRICE each 15 minute-chunk (roughly). I tested it on DOW 50 ticks to have more separation between text:
12345678910111213141516171819202122232425262728293031323334353637383940414243DEFPARAM DrawOnLastBarOnly = trueDistanza1 = 5 * pipsizeDistanza2 = round(Distanza1 * 1.5)IF barindex = 0 THENq1 = 0q2 = 0q3 = 0q4 = 0ENDIFIF OpenMinute >= 15 AND OpenMinute[1] < 15 THENq1 = closeb1 = barindext1 = OpenTimeELSIF OpenMinute >= 30 AND OpenMinute[1] < 30 THENq2 = closeb2 = barindext2 = OpenTimeELSIF OpenMinute >= 45 AND OpenMinute[1] < 45 THENq3 = closeb3 = barindext3 = OpenTimeELSIF OpenMinute >= 0 AND OpenMinute[1] > OpenMinute THENq4 = closeb4 = barindext4 = OpenTimeENDIFIF q1 > 0 THENDRAWTEXT("time : #t1#",b1,q1 + Distanza2)DRAWTEXT("close: #q1#",b1,q1 + Distanza1)ENDIFIF q2 > 0 THENDRAWTEXT("time : #t2#",b2,q2 + Distanza2)DRAWTEXT("close: #q2#",b2,q2 + Distanza1)ENDIFIF q3 > 0 THENDRAWTEXT("time : #t3#",b3,q3 + Distanza2)DRAWTEXT("close: #q3#",b3,q3 + Distanza1)ENDIFIF q4 > 0 THENDRAWTEXT("time : #t4#",b4,q4 + Distanza2)DRAWTEXT("close: #q4#",b4,q4 + Distanza1)ENDIFRETURN1 user thanked author for this post.
10/10/2019 at 9:10 AM #109784Thanks for your Help Roberto for Q2/,
The algotrithm you use is very similar, based on minute instead on Time in the example I posted.
Basically the data are biased the exact same way depending on the number of ticks I use in the chart .
With your algorithm, it will be based on the opentime, with mine on the close time.
On 200 ticks, I have the exact same issue. So I should use a very small number of Ticks to reduce the delay (data biased time);
I would still need it to be used on a larger tick display, typically 200 to 10000. And I believe there is no way in PRT to pass data from an indicator in a given timeframe to another graph in another timeframe (global variables, queue pipes, even files)?
10/10/2019 at 10:17 AM #109792No, there’s no support for local/global variables and no MTF is supported by ProBuilder.
To make more room between text with a higher number of ticks you could add some further distance one time, then subtract it next time so that you get some vertical separation.
10/10/2019 at 2:09 PM #109824Thanks Roberto
What I need is the close value at a precise time on a tick chart using ticksnb with (200<ticksnb<10000).
Vertical bars and all my sample code is a subset I did to focus on the issue I have.
The target code would be way more complex.
Understanding that when an IF-THEN based on time is true in tick mode, it remains true till the bar ends (and that looks clearly a limit/defect to me), I used a WHILE instruction.
Unfortunately, this does not work in PRT neither, the WHILE seems to be executed, but only at the close of the candle.
This is another issue in PRT code execution strategy in ticks.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960ONCE FutTime=40000ONCE s=2*pipsizeCH=HourCM=Minute//CMC=MinuteCloseTime=CloseCT=TimeCTC=TimeBI=barindexY=highv=volumeDRAWTEXT("Time: #CT#" , BI, Y+10*s)DRAWTEXT("Current time: #CTC#" , BI, Y+9*s)DRAWTEXT("FutTime: #FutTime#" , BI, Y+8*s)DRAWTEXT("Volume: #v#" , BI, Y+7*s)DRAWTEXT("Close0: #closeTime0#" , BI, Y+6*s)DRAWTEXT("Close1: #closeTime1#" , BI, Y+5*s)DRAWTEXT("Close2: #closeTime2#" , BI, Y+4*s)DRAWTEXT("Close3: #closeTime3#" , BI, Y+3*s)DRAWTEXT("Close4: #closeTime4#" , BI, Y+2*s)DRAWTEXT("Nb hits: #CountMM5M15#" , BI, Y+1*s)IF CT > FutTime AND CT<220000 Thenwhile yabug=CountMM5M15 do // and add a while as the kludge is the basic kludgeclosetime4=closeTime3closeTime3=closeTime2closeTime2=closeTime1closeTime1=closeTime0closeTime0=closetimeCountMM5M15=CountMM5M15+1 // This is the basic kludge while endY=closes=-sDRAWTEXT("Time: #CT#" , BI, Y+10*s)DRAWTEXT("Current time: #CTC#" , BI, Y+9*s)DRAWTEXT("FutTime: #FutTime#" , BI, Y+8*s)DRAWTEXT("Volume: #v#" , BI, Y+7*s)DRAWTEXT("Close0: #closeTime0#" , BI, Y+6*s)DRAWTEXT("Close1: #closeTime1#" , BI, Y+5*s)DRAWTEXT("Close2: #closeTime2#" , BI, Y+4*s)DRAWTEXT("Close3: #closeTime3#" , BI, Y+3*s)DRAWTEXT("Close4: #closeTime4#" , BI, Y+2*s)DRAWTEXT("Nb hits: #CountMM5M15#" , BI, Y+1*s)DRAWTEXT("Yarg: #yarg#" , BI, Y+1*s)s=-sy=y+1IF CM < 58 thenFutTime=CH*10000+(ROUND(CM/2)+1)*200ELSEFutTime=(CH+1)*10000DRAWVLINE(barindex) coloured (0,0,128) // test to see whether the test works: should draw a vertical line each hourIF FutTime > 210000 thenFutTime= 040000 // make sure we do not collect value between 21:00:00 and 4:00:00 (fixed timings depending on local TZ)CountMM5M15=0ENDIFENDIFWENDELSEyabug=CountMM5M15 // This is the basic kludge, Invert IF condition and use a while to kludgeENDIFReturn10/10/2019 at 2:40 PM #109827 -
AuthorPosts
Find exclusive trading pro-tools on