OnChart Stochastic as exit factor LONG

Forums ProRealTime English forum ProOrder support OnChart Stochastic as exit factor LONG

Viewing 3 posts - 16 through 18 (of 18 total)
  • #88623

    Here is the full strategy in which I prefer to have the indicator embedded in the code without calling, as for optimization reasons. I still cannot understand why it does not work….

     

     

    #88626

    To have a chance to debug code correctly and fast enough, you should (always):

    • write clear, readable, easy to understand code
    • use correct alignement of code to make it easier to spot erroneous lines
    • use meaningful names, BUFFER1,BUFFER2,BUFFER3,BUFFER4,BUFFER5 will lead to slower debugging code and is prone to errors (as you’ll see in a while)

    Line 27 is better written like I did, so, in case you want to change Ob/Os tresholds, you’ll have just to change line 26 (not line 27, not anymore).

    Line 50, with meaningful names, shows why you entered a trade and could not exit until you had wiped out your capital. It’s because generic, confusing names didn’t allow you to spot that the last part of line 50 is impossible to become true, thus your strategy never met a BEARish condition to exit a trade.

    Line 50, the second condition was also wrong; with meaningful names you can easily spot it.

    There you go:

     

    1 user thanked author for this post.
    #88647

    Thank you very much Roberto. That makes all the sense in the world, and it even solved the problem. I have learned a lot from you. Thank you for being so patient with me!

Viewing 3 posts - 16 through 18 (of 18 total)

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