Multi Timeframe problem
Forums › ProRealTime English forum › ProOrder support › Multi Timeframe problem
- This topic has 7 replies, 2 voices, and was last updated 2 years ago by robertogozzi.
-
-
09/27/2021 at 12:32 PM #178557Sells when SAR changes1234567891011121314151617181920212223242526272829DEFPARAM FLATAFTER = 160000// Prevents the system from creating new orders to enter the market or increase position size before the specified timenoEntryBeforeTime = 100200timeEnterBefore = time >= noEntryBeforeTime// Prevents the system from placing new orders to enter the market or increase position size after the specified timenoEntryAfterTime = 160000timeEnterAfter = time < noEntryAfterTimeONCE Start=100000If Time =start thenTradecount=0EndifTimeframe (30minutes,updateonclose)c1= (close[1]-open[1] )c2=c1<0Timeframe (default)c3=SAR[0.02,0.02,0.2]c4=close>c3 AND close>openc5=close <supertrend[3,6]IF c2 AND c4 And c5 AND Tradecount<1 AND timeEnterBefore AND timeEnterAfter THENSELLSHORT 3 CONTRACT AT MARKETTradecount=Tradecount+1ENDIF// Stops and targetsSET STOP pTrailing 16SET TARGET pPROFIT 3.4
A trade is being triggered when the condition in the 30 minute timeframe is not met and I can’t see why .The default timefame is 20 seconds.
Any help greatly appreciated.
09/27/2021 at 1:30 PM #178566On Which instrument did you test it?
1 user thanked author for this post.
09/27/2021 at 5:24 PM #178586It works fine for me.
I suggest that you append these lines at the end of your code:12graph c2graph c1so that you can monitor their value when the trade enters (actually the candle BEFORE the arrow plotted by ProBackTest).
1 user thanked author for this post.
09/27/2021 at 10:41 PM #17861109/28/2021 at 1:25 AM #178614Sell-SAR
The problem is that the 30 minute calculation is being done on 2 bars before the current bar .The entry on 27th Sept is at 10:49 but the C1 value is the the value for the 9:30 bar on the 30 minute chart.
I need some help to insert a screen print into my reply
09/28/2021 at 2:11 AM #17861709/28/2021 at 7:26 AM #178620Do not insert pics in your posts, only attach them using the appropriate button.
Thsnks 🙂
09/28/2021 at 7:33 AM #178621It’s important, back to your question, that conditions are met on the 30-minute TF when the trade is entered.
There are 90 20-second bars in 30 minutes, so more trades can be opened before the next 30-minute bar opens.
C2 is met for 30 minutes.
1 user thanked author for this post.
-
AuthorPosts
Find exclusive trading pro-tools on