Help with a condition

Forums ProRealTime English forum ProOrder support Help with a condition

Viewing 15 posts - 1 through 15 (of 29 total)
  • #79071

    Hi friends,

    I’m working in an automated strategy but I’m having problems with an issue.

    I would like to make entries only under a condition. I would like to open shorts when last RSI min. value was between two values, and open longs when last RSI max was between another two values.

    I’ve got it defining a N bars number, but I don’t want to use the bars number. I think it may be solved using ONCE or WHILE instructions but I can’t find the way.

    My code now is as following:

    Open longs:

    Open shorts:

    But I would like to obviate the [20] bars value using something similar to

    I tried wih ONCE too but didn’t work.

    Could you guide me to find a solution?

    Thanks to all the community.

    #79074

    If you post your full code then I / we could easily run it on our Platforms and it then easier to offer help rather than us having to make above into a working System to check it out.

    If you not want to share your full code then I guess some expert coder may spot an anomaly and / or offer suggestions?

    #79075

    I’m not sure I fully understand your problem.

    First of all you need to give your RSI’s a period. For example:

    Why not use a simple IF THEN ENDIF?

    The code is read through once at the close of a candle and if your condition of looking back for the lowest RSI and highest RSI over your look back periods is met then whatever you want to do is carried out.

    The ONCE instruction means that whatever is written after it is only read at the close of the very first candle and ignored every candle after that.

    #79076

    Hi GraHal of course. Also I’ve been all night working on it and I changed a few things to enhance it.

    Basically I change RSI by RSX and results are much better now. However code is a bit frankenstein…don’t laugh please 🙂

    It’s for DAX M1 and my main question is how to avoid RSXBARS for no limiting trades at that certain vars number. I spent much hours testing with WHILE and ONCE but I can’t solve it.

    Also, any other idea to enchance strategy is welcome 🙂

    Thanks a lot!

    1 user thanked author for this post.
    #79077

    Hi Vonasi, thanks a lot for your response.

    The main problem is defining last condition in a certain number of bars may limit amount of trades done.

    What about if RSI or RSX condition is made on last 30 bars and not 14 or 20? I don’t want to lose those trades. So I would like to save in a floating var the last point where that condition were done and open trades in base at that condition.

    I’m not sure if I explain it right at all, sorry.

    #79078

    However code is a bit frankenstein…don’t laugh please

    I’m not laughing at the code, but I am at the joke! Very  good!! I’ll have to remember that one! 🙂

    But I have to say I am a bit scared by the monster!

    Also you must look and feel like a monster if you have been up all night coding!?

    I tried it on my Platform over 100k bars on DAX 1 min and it executes nil / zero trades … so that is the first problem – no trades – Yes??

    #79079

    Hi GraHal,

    I don’t feel like Frankie…instead I want more coding…I’m getting addict 😀

    I don’t have problems with code, but I upload it to test it. In 100000 bars doesn’t have great results but yes at 10.000 and 30.000 and my idea is updating vars to adapt it at market conditions.

    I attach also some performance results.

    Thanks again.

    #79083

    I test it at IG DAX 1€ cash.

    #79084

    I got 1 trade on a 5 min TF over 100k bars on DAX so my conclusions would be that your code has far too many AND conditions and they are not being met all at the same time.

    I tried deleting Buy conditions one by one and I got trades (on 1 min TF) but they lost loads and loads of £££s.

    I think you need to put chains / ropes on Frankenstein  v1.0 and start on Frank v2.0 with far less conditions??  See if you can get signs of life in a finger before putting the whole monster body together?? Sorry couldn’t resist that! 🙂 🙂

    On a less jokey note … did you run the System and get trades after adding each condition or did you write lots of conditions and then run the code (apply the lightning bolt to Frank!)??

    Edit / PS

    I wrote above before I saw your post with results … weird that I get zero trades? I’ll try running again again and report back.

    #79086

    Hi GraHal,

    I don’t know which may be the real problem with your tests. I’m testing in € and capital is configured in PRT strategy window.

    • Initial capital: 600€
    • Spread: 2

    Also, my country is Spain…not sure if it may affect to tests and results, because it works from 10:10 to 17:25 to avoid high commissions and market openings.

    If you see performance data attached, are very promising. Of course I would like to reduce vars and conditions but I think it works nice for me.

    About my doubts, have you got any idea? It’s adding some more code but I don’t fear of it 😀

    Thanks again for your comments.

    #79089

    Aha I try it now on my Spread Bet Platform and I get 1 trade on DJI at 1 min TF (still no trades on DAX 1 min on CFD or SB PLatform).

    Bit of a mystery, maybe it is the Time settings difference between our Platforms … Ill convert the times and report back.

    EDIT / PS

    To get same the lightning bolt at same time as Spain, I knocked 1 hour off Flat Before / After and still the same results … no trades on DAX at 1 min. Also I used the .itf file … so I have all Franks body parts in my Test Lab also! 🙂

     

    #79092

    but yes at 10.000 and 30.000

    What do you mean re above?? 10 AM and 3 PM or what?

    #79094

    Sorry… 10000 and 30000 BARS

    In Spain we use dots [.] instead commas [,] for thousand separations.

    Regards.

    1 user thanked author for this post.
    #79099

    @komiya Are you 100% sure that the results you show in post above are results for the code in the .itf file??

    I can’t understand how you get trades and I don’t with the same code on same data on same TF etc etc??

    Anybody else offer any thoughts on why nil trades for me and 95 trades for komiya??

    #79101

    Hi, I reupload again but it’s working nice for me…

    Anybody else may test it and think about my question?

    Thanks a lot people!

Viewing 15 posts - 1 through 15 (of 29 total)

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