Trading Cash Session
Forums › ProRealTime English forum › ProOrder support › Trading Cash Session
- This topic has 28 replies, 5 voices, and was last updated 1 year ago by FritzAlgo.
-
-
09/11/2023 at 5:30 PM #220789
Hi – am wanting to just trade the cash sessions, and get OHLC prices from the cash session for SPY (SPTRD on IG) and not the 24hr priced product they offer. For example, I want to know the open price of SPY (at 15:30 CEST) and OHLC for the previous day. Is there a function that can be called?
Thanks
09/12/2023 at 7:09 AM #22082009/12/2023 at 7:36 AM #220821Hi JS – I use PRT to trade with IG. Most of their products price 24/7, so for SPY (SPTRD) there is no product that just trades the cash session. I would like to take the OHLC for each cash session in PRT and use these in my algo. If price close down 5 days in a row then buy would be price at close of cash session and not midnight which IG quotes. Has a big impact on strategies.
Thank you very much
09/12/2023 at 7:53 AM #22082709/12/2023 at 8:39 AM #220832Fritz, I think I see what you mean, if we compare it with e.g. DAX. But please confirm.
DAX closes at 22:00 (Amsterdam). But the session ends at 17:30. Don’t ask me when it opens thinking like this, but I would say 17:30 the previous day.
So if this is what you mean, yes this makes a huge difference, often.For SPY/SPTRD this would mean 15:30 till 22:00. Here too the difference can be huge, because of Q figures reported at 22:00 or just past that. Especially when the big ones disappoint (e.g. AAPL).
If this is what you mean, then the task is relatively easy : loop through those (RTH) hours and find the OHLC in there. Maybe someone can make you an example (I never have spare time for these things – sorry). When the example is there, you should yourself incorporate daylight savings.
But first : is this what you mean ?09/12/2023 at 9:14 AM #22083509/12/2023 at 9:31 AM #2208361234567DLS = 0 // 30-10-2022,PS. 0 = Normal. 1 = Autumn. 2 = Spring.If Date >= 20221031 and Date <= 20221104 thenDLS = 1 // Autumn. USA is one hour early.elsif Date >= 20230312 and Date <= 20230326 then // 11-03-2023,PS.DLS = 2 // Spring. USA is one hour early. Can be set to 1 as well because there won't be a difference between Autumn and spring.endifThis is the code snippet for Daylight Saving of the past year. Mind you, this is about the difference with the US. You will need this for backtesting.
For the near future : Wintertime in Holland/Germany starts on 29-10-2023. For the US this is 5-11. You will need this soon.
Regards,
Peter1 user thanked author for this post.
09/12/2023 at 10:41 AM #22084809/12/2023 at 12:45 PM #220864I thought to have read somewhere on this forum that daylight savings was automatically adjusted if the algo was started in its assigned timezone? I have done this with all of mine but also have several calendar reminders to check this is true.
09/12/2023 at 1:00 PM #220868Can you show us this text ? I mean, I recall it too but don’t know where I read it. Point is : this seems quite impossible OR impossible to handle well. I now like to look into it again.
But :
You guys over there are experts at solving these issues, because you have to (unlike us over here). So you very well can be right !
1 user thanked author for this post.
09/12/2023 at 1:10 PM #220870PeterSt I have a very hard time finding anything I read on this forum a second time because it’s been designed by a programmer thinking in 1’s and 0’s. I save multible tabs for days if it’s relevant haha
But for sure my earliest systems were/are time based opening drive systems and I made the rookie error of running everything in UTC +10. It was a nightmare interfering with the backtest and record keeping because of the bits and pieces after systems were switched over. Now I have to re-start every time I change instrument which seems insane but at least it gets things right enough. So now the backtest recognises/adjusted for daylight savings but I havn’t tackled one since earlier in the year. So best set a reminder to make sure is sure.
Triple check everything in this business.
09/12/2023 at 1:56 PM #220872Daylight savings code
Is that what you did ?But it should cover for aspects like I wrote about here.
PS: Yes, finding things in this forum is virtually impossible. Oh, maybe the search gives results, but then dealing with the outcome pages – it is killing. I always use Google. E.g.:
prorealcode daylightsavings09/13/2023 at 12:11 PM #220926No I didn’t. But I’m glad you linked it for me, thanks. Just as easy to set a calendar reminder to double check this year and update the time in code if needed, but back tests work fine as long as I use Sydney time not Brisbane.
But you know there are other ways to do it. Some of my codes just use volatility to switch on which gives the added bonus/or not of trading outside hours for volatility events. I suppose we’ll get one shortly!
Also, I am now working on a giant regime filter using percentage ATR and dynamic position sizing. Early tests look promising and I can incorporate it into all algos and hopefully do away with time altogether. Then I can stop needing to schedule my margin on a timetable so much and simplify my tasks.
09/13/2023 at 12:37 PM #220933Please can someone tell me how I capture the open price at 15:30 and the close at 22:00 etc. for each day?
Fritz, sorry to hijack your thread, I’ll bump your question back up.
I’m not sure exactly what your saying, if you are looking to make a back test of your strategy or build a stock screener? You can try using the ProScreener section of the Forum.
09/13/2023 at 1:21 PM #220936Thanks coincatcha
When I run algo on different platform that uses cash session prices eg for US products 15:30 to 22:00 the results are much better than when I run algo on IG continuous CFD equivalent. Every time, without fail. Price move sideways around midnight and erode O/N gaps etc.
Attached screenshot show algo that on IG’s continuous CFD products suffer loss in 2018 which live algo trading the cash session with a different broker did not experience. It make money that year and return profile very different, had better return. This just simple example to make point.
How to capture OHLC prices for cash sessions for an algo to reference? Alternatively I could open an account with Interactive Brokers who offer cash session prices and not these continuous products.
Thanks
-
AuthorPosts
Find exclusive trading pro-tools on