Exit trade just before the close for the day
Forums › ProRealTime English forum › ProOrder support › Exit trade just before the close for the day
- This topic has 8 replies, 4 voices, and was last updated 4 years ago by
robertogozzi.
-
-
04/21/2021 at 1:49 PM #16770204/21/2021 at 2:02 PM #167704
this should do it:
1234if CurrentDayOfWeek = 5 and time = 172000 thensell at marketexitshort at marketendif1 user thanked author for this post.
04/21/2021 at 2:32 PM #167705When using the example given by nonetheless you have to ensure that the chart you are using the strategy on has a 172000 candle. So you must run it on a TF of 10 minutes or faster.
2 users thanked author for this post.
04/21/2021 at 2:51 PM #167708Thank you
I guess I was a bit unclear about the day of exit. I meant 5th day after entry not day of week.
Do I have to choose a time unit in backtesting that correspond to time? In the this case 1 hour of less?
In this strategy I have only daily bars. Does that mean I can’t solve my need?04/21/2021 at 3:03 PM #16771204/21/2021 at 4:03 PM #167720In this strategy I have only daily bars
Sorry Erike, when you mentioned 17:20, I assumed you were working with a short time frame. I may be wrong but I don’t think you can close in the middle of a daily candle without using MTF
1 user thanked author for this post.
04/22/2021 at 7:31 AM #167745No problems @nonetheless .
I guess I have to read up on MTF. Any suggestions were to start?04/22/2021 at 8:09 AM #16775004/22/2021 at 9:07 AM #167761There you go (not tested):
123456789101112131415161718192021Timeframe(Daily,UpdateOnClose)Once Count = 0Count = Count + OnMarketIf MyLongConditions and Not OnMarket thenBuy 1 contract at MarketCount = 1Set Target pProfit 500Set Stop pLoss 250EndifIf MyShortConditions and Not OnMarket thenSellshort 1 contract at MarketCount = 1Set Target pProfit 500Set Stop pLoss 250Endif//Timeframe(default)If Count = 5 and Time = 172000 ThenSell at MarketExitshort at MarketEndifYou need to run this strategy from a 10-minute (or lower) chart.
2 users thanked author for this post.
-
AuthorPosts
Find exclusive trading pro-tools on