Why wont this work? Please Help! (Color Changing TMA Slope) - Page 4
Page 4 of 734 FirstFirst ... 234
Results 31 to 40 of 340

Thread: Why wont this work? Please Help! (Color Changing TMA Slope)

  1. #31
    Sorry but I can not replie the error you're referring to.

  2. #32
    Thank you both for your replies -

    Kilian - it only occurs when on new bars being processed. If you load the indior, or reload it, it is going to appear ideal. But when using in actual time, at the turning points in which before we'd holes, it is going to print both buffers.

  3. #33
    Quote Originally Posted by ;
    Thank you both for your replies - Kilian - it just occurs when on new pubs being processed. If you load the indior, or reload it, it is going to look perfect. But when using in actual time, at the turning points where before we had holes, it is going to print both buffers.
    I believe that should be difficulty #6 I talked a page ago .

    Quote Originally Posted by ;
    #6
    as Soon as You have that fixed the historical bars ought to be correct. But think about what happens when the current bar is close to the threshold and will be over and below 0 during the same bar? What values will be stored...

    I will have a look at it though and see if it really caused by that dilemma

  4. #34
    Any Fortune Kilian?

    EDIT: placing it to compute just when the pub has closed appears to address the issue. But, I simply don't know why it doesn't work when it is calculating/updating on the current bar. It needs to be simple enough -

    if Xcurrentgt;=Xprevious - do this

    else do this

    There are three choices , up down or equal, and all three are coated by employing gt;= and lt;

    Correct?

  5. #35
    This seems to have solved the issue - taken from another color changing moving average indior -
    https://www.forexsoutheast.asia/atta...5940375767.mq4

  6. #36
    Quote Originally Posted by ;
    EDIT: placing it to calculate just when the pub has closed appears to address the problem. But, I just don't understand why it does not function when it is calculating/updating on the current pub. It needs to be easy enough -
    Yes there are just three possible cases but they can occure during precisely the exact same bar.

    Tma is below 0

    Upbuffer = 1
    Downbuffer = 0

    If the Tma is higher 0 the buffers seem like this

    Upbuffer = 1
    Downbuffer = 1

    The Ideal way would be not to just to assign a value to the current buffer but to erase the value of the old buffer too

    if(TmaUp)

    Up = 1
    Down = EMPTY_VALUE

    else

    Up = EMPTY_VALUE
    Down = 1

  7. #37
    Kilian - that doesn't work. It creates holes in the plot in the turning points.

  8. #38
    Quote Originally Posted by ;
    Kilian - that doesn't work. It creates holes in the plot at the turning points.
    Yes at the turning point but that shouldn't be the problem I thought the problem is that the bar after the turning point at the turning point both values have to be plotted, thats why we put that code in in the first loion! At least that's what I imagined. I haven't had time to check out the indior today.

  9. #39
    In my view mql4 is a badly written speech. Anyways that's a bug that occurs but isn't that crucial as you won't be altering the code all the time .
    One thing you might want to try is adding the color property for the Buffers from the SetIndexStyle call.

  10. #40
    Quote Originally Posted by ;
    quote Yes in the turning point but shouldn't be the issue I thought the problem is the bar following the turning point in the turning point both values need to be plotted, thats why we put that code in in the first place! At least that is what I guessed. I have not had time to check out the indior today.
    The dilemma is that both buffers become plotted during a bar where the indior is spinning - which is what happens through the solution we originally put in, it prints both buffers rather than directly on top of each other so it's possible to see both buffers (hard to explain, the pic above shows what I believe ). The solution that I posted above seems to work as intended... Thanks for the continuing help -

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
This website uses cookies
We use cookies to store session information to facilitate remembering your login information, to allow you to save website preferences, to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners.