Trading Cash Session

Forums ProRealTime English forum ProOrder support Trading Cash Session

Viewing 14 posts - 16 through 29 (of 29 total)
  • #220938

    Am I over-simplifying your question (and missing the point? : ) ) … why not include times in your Algo codes so that trading occurs ONLY during the Cash Session?

    #220944

    Hi GraHal

    Thank you for idea – I tried that but does not address issue.  When I write an algo that says if close < close[1] or an indicator that derive it value from close, this is where the problem is.  Close price on IG at midnight, not 22:00.  Values are always different, introduce creep into prices which over time erode performance.

    If I draw RSI[14] it take close price from IG, which is at midnight again, not 22:00.  So even RSI value different to that of cash session.

    #220976

    What timeframe are you using on your Platform.

    If you use 1 Hour timeframe then time can be to nearest hour, if you use 5 min timeframe then time can be to nearest 5 mins etc.

    Timeframe(1 Hour, updateonclose)
    If Time = 220000 and close < close[1] Then
    Sell at Market
    Ensdif

     

    #220977

    Thanks GraHal

    In code you show, would close[1] just be close of last 1 hour candle?  So close at 21:00 same day?

    #220978

    Yes

    My code suggestion won’t work if you are using ‘end of day data’ … are you??

    Most of us with IG have full data (i.e. not end of day only)

    #220980

    Hi GraHal

    I have full data. That not the issue.  I can run algos on full data (continuously priced CFDs from IG 24/7 from Monday to Saturday) but performance worse than if I run same algo on actual stock market times (15:00 to 22:00).

    Seems to be no way to reflect real market, or store market price at time of open (15:00) and close (22:00) each day to refer to instead.

    Ok, I go back to other platform / broker for these algos

    I am grateful for everyone help and quick ideas, thank you

    #220985

    Seems to be no way to reflect real market, or store market price at time of open (15:00) and close (22:00) each day to refer to instead.

    So just to close the loop before you go … what was wrong with my idea … use Times in your code?

    You can read and store (in your code) OHLC values at 15:00 and 22:00 … if you ask on here somebody will code it for you I’m sure.

    #220988

    Yes – I think we are on the same page now, but I still wait for someone to kindly show me how to code 🙂

    Thank you again for help

    #220989

    It be best to open a new Topic with a Title which describes what you want, e.g.

    Please – Code to Store OHLC values at Cash Market Hours.

    Then you state what you want and the hours etc.

    There are a few very helpful members on here, but they need a specification in words as to what needs coding else they may waste their very valuable time.

    It’s also useful to be brief and to the point exactly what you want.

    I just read back over your posts in this Thread and – am I understanding correctly – you want every OHLC value at open and close of cash session / exchange market hours … what, for the past month, 12 months or just yesterday??

    Code would be very cumbersome to capture more than a few days worth of OHLC values.

    Anyway, further discussions would be best in a new Topic if you want to continue?

    #220990

    If you’d ask me … this is ridiculous. After a handful of posts it was totally clear what needs to be done. Why open a new topic for it ?
    It is only that apparently nobody likes to do it. Or can do it ? This includes me, and I told so (it would be the first from my hand as I exactly never do these things in this forum).

    Loop from 15:30 to 22:00 and register OHLC within that period. Actually High and Low would be sufficient, me thinks.
    I recall that Fritz suggested that IBKR / PRT-IB would be able to do that automatically,  but this is not something I automatically recognize. This is because ETH is explicitly dealt with by PRT, although that is a setting (want to trade ETH Yes/No). Thus, TF = 1 Day and then e.gf. High(Close[1]) ? I bet you that does not work out as desired; it will just incorporate the bars until 00:00.

     

    #221002

    Maybe nobody provided code because FritzAlgo never made it clear what he wants?

    If all he wants is to open a Buy if Cash Open > Cash Close yesterday and Sell if Cash Close < Cash Close yesterday then that is easy.

     

    #221005

    For everything a first time.

    Of course it requires some more, like undoubtedly the requirement to look at the High etc. from the previous day.

     

    2 users thanked author for this post.
    #221009

    FritzAlgo Peter’s kindly provided code needs to be run on 30 minutes or less Timeframe.

    1 user thanked author for this post.
    #221072

    Hello PeterSt

    Thank you very much, I am so grateful to try.  Sorry, I tested positive yesterday and not feeling good so will go back to testing early next week I hope.  I will come back here and share results.  Excited to try

     

    2 users thanked author for this post.
Viewing 14 posts - 16 through 29 (of 29 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login