Alignment of MA for the first time

Optuma Forums Optuma Scripting Alignment of MA for the first time

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #63059
    Deepak
    • Topics: 85
    • Replies: 71
    • Posts: 156

    Hii I am using below formula for MA aligning for the first time but its not working. Any ideas?

    #63081
    Mathew
    • Topics: 40
    • Replies: 2,021
    • Posts: 2,061

    Hi Deepak,

    What do you mean by aligning? Can you please provide more information?

    Also please try to format the scripts so they are a little easier for us all to read.

    All the best

    Mathew

    #63093
    Deepak
    • Topics: 85
    • Replies: 71
    • Posts: 156

    Hiii Sir,

    I wanted to know when the MA make the following condition true for the first time.

    MA 21 > MA 50
    MA 50 > MA 100
    MA 100 > MA 150
    MA 150 > MA 200

    For this i have used following code.

    Regards,
    Deepak

    1 user thanked author for this post.
    #63094
    Matthew
    • Topics: 5
    • Replies: 631
    • Posts: 636

    Hi,

    You’re looking for several criteria to be true at once, so you need to have them connected via AND operators.

    Example:

    You can then use the BARSTRUE() function to find the first bar where this criteria swaps from False to True.

    On a chart it looks like this (Show View along the bottom).

    Ex5

    After triggering, it won’t trigger again until the criteria goes back to False, then is met once more.

    #63095
    Deepak
    • Topics: 85
    • Replies: 71
    • Posts: 156

    Hii Sir,

    I used the suggested formula however the results are different.

    MA alignment

    Cant i use change to function.

    Regards,
    Deepak

    #63096
    Matthew
    • Topics: 5
    • Replies: 631
    • Posts: 636

    Hi,

    If you prefer to use ChangeTo you can.  It’s a simple adjustment to the final line.

    2 users thanked author for this post.
Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.

Pin It on Pinterest