MULTI TIME FRAME
Forums › ProRealTime English forum › General trading discussions › MULTI TIME FRAME
- This topic has 9 replies, 2 voices, and was last updated 5 hours ago by andyfx79.
-
-
01/17/2025 at 1:07 PM #242720
Hi can anyone advice me on the correct way to code multi timeframes ?
The issue I’m have every time the code is triggered it only takes in to account the smaller TF . Could it be that the 10 minute TF takes in to account c1 and c2 rather than them working in sync with each other ( what I want is provided the 4h TF (c1) is correct then it will go ahead and activate the trade on the smaller TF (c2)
any help will be very much appreciated.
12345678910111213141516171819202122// Definition of code parametersDEFPARAM CumulateOrders = False // Cumulating positions deactivated// Prevents the system from placing new orders on specified days of the weekdaysForbiddenEntry = OpenDayOfWeek = 6// Conditions to enter long positionstimeframe(4h)ignored, indicator1 = CALL "Storyteller 3.0"[1]c1 = (indicator1 > 0)timeframe(10 minutes)indicator3, indicator4 = CALL "Storyteller 3.0"[1]c2 = (indicator3 crosses over indicator4)IF (c1 AND c2) AND not daysForbiddenEntry THENBUY 1 PERPOINT AT MARKETENDIF// Stops and targetsSET STOP pLOSS 100SET TARGET pPROFIT 10001/17/2025 at 2:16 PM #242721I want is provided the 4h TF (c1) is correct
As your code is written, anytime c1 = indicator1 > 0 during a 4 hour bar, then C1 will be True / 1.
So C1 may be coincident with C2 6 times per hour at the end of each 10 minute bar (assuming your Chart is running on 10 min Timeframe?).If you want C1 to be checked ONLY at the end of each 4 hour bar, then you need to use …Timeframe(4h, updateonclose)ignored, indicator1 = CALL “Storyteller 3.0”[1]c1 = (indicator1 > 0)01/17/2025 at 2:48 PM #242722As it stands at the moment c2 ( 10 min TF ) will take all long positions irrelevant whether or not c1 (4h TF) is above or below the 0 line , meaning its entering a long position during a down trend on the 4h . I’ve tried updateonclose and it appears not to make ant difference.
thanks.
1 user thanked author for this post.
01/17/2025 at 3:07 PM #24272501/17/2025 at 3:19 PM #24272801/17/2025 at 3:24 PM #24272901/17/2025 at 3:49 PM #242730hi I’ve tried using storey teller 3.0 and also just tried using a different indicator ( MACD) and getting the same results back , taking long positions even when the 4h tf ( MACD) is below the 0 line . Just cant get them to work in sync with each other >
01/17/2025 at 4:08 PM #242731Post your code with the MACD and I will try on my Platform.
I am more of a ‘trial and error coder’. It’s not easy for me to see what might be going wrong without testing your code.
I am wanting to help andyfx79 to move onward and upward … so if anybody can see the problem then please join in and tell us! 🙂
01/17/2025 at 5:58 PM #24273201/17/2025 at 8:52 PM #242744I’ve added c3 to the code and it confirms that c1 and c2 are not in sync using the storey teller , however it seems to work using the macd so I’ve come to the assumption that the issue lies within the storey teller indicator ,
1 user thanked author for this post.
-
AuthorPosts
Find exclusive trading pro-tools on