Don’t want sundays to be shorn/counted

Forums ProRealTime English forum ProRealTime platform support Don’t want sundays to be shorn/counted

Viewing 7 posts - 1 through 7 (of 7 total)
  • #243133

    Hi,

    Not sure if this has been posted in the right place?

    I am trading US Tech1 100 CFD with automated strategies using ProRealTime on the web. The issue is: Sundays are appearing and included in the calculation of indicators, and trades can be made on Monday at 01:00 based on Sunday’s calculations. I only want Monday through Friday to be included… Is there anything I can do to achieve that?

    #243135

    I’ve run into this same issue and found the best approach is to adjust the code so Sundays are completely ignored. For example:

    IF OpenDayOfWeek > 0 AND OpenDayOfWeek < 6 THEN

    // Your trading conditions and execution logic here

    ENDIF

    You’ll also need to modify any indicators that span multiple days. For instance, for a 200-period moving average, you’d adjust to account for extra Sunday bars (e.g., use Average[240] instead of Average[200] when working with daily charts).

    It’s safer and more robust to handle this in your code rather than rely on a workaround that depends on compatibility between ProRealTime and your broker. I also find it frustrating to see a daily bar for Sunday on platforms like IG when the market has only been open for a couple of hours. It throws off both visual analysis and indicator calculations.

    If anyone else has tips or alternative solutions, I’d love to hear them!

    3 users thanked author for this post.
    #243156

    Thank you very much. It solves how not to trade on Sunday, but how to remove Sundays from, for example, RSI calculations? Any suggestions? It’s strange that on the IG App sundayg are remowed, but not in the ProRealCode web-solution. If it would be possible to use data from IG App or IG web platform, the problem would be solved.

    #243161

    Based on this indicator of mine at https://www.prorealcode.com/prorealtime-indicators/time-range-moving-averages-simple-exponential-weighted-trsma-trema-trwma/, I modiefied the TREMA to adapt it to days of the week, instead of times (but the two solutions could be easily combined):

    There’s no way to have default indicators adapted. Each desired indicator of which the source code (or at least its formula) is known coud be tested and probably adapted, but this ios not 100% guaranteed and is for sure time consuming.

     

     

    2 users thanked author for this post.
    #243168

    Thank you very much, robertogozzi! You don’t happen to have a formula calculating RSI without  sundays?

    #243189

    Yes, I’ll code it asap 🙂

     

     

    1 user thanked author for this post.
    #243196

    Thanks – I really appreciate it, and I’m sure many others do too! I trade using the 2-day RSI strategy, and it’s critical that the RSI is accurate.

Viewing 7 posts - 1 through 7 (of 7 total)

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