fxDreema

    • Register
    • Login
    • Search
    • Back to the main page
    • Categories
    • Recent
    • Tags
    • Popular
    • Search

    Simple 'Close trade after crossing Moving Average' not working

    Questions & Answers
    2
    2
    332
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D
      djredwood last edited by

      Hi, I hope someone can please help me.

      I have created an EA that I want to close trades after crossing a moving average (after the trade has been entered manually) however my EA closes the trades immediately after loading, not after crossing the MA.

      The conditions are:

      If in a manually entered buy trade, close the trade after bar crosses from ABOVE and closes BELLOW the Moving Average.

      If in a manually entered sell trade, close the trade after bar crosses from BELLOW and closes ABOVE the Moving Average.

      Does anyone have some advice for me on how to get this to work. I have attached the my EA here.

      0_1621001456931_MA CLOSER 5.mq4

      1 Reply Last reply Reply Quote 0
      • Johann 0
        Johann 0 last edited by

        It closes because you have your candle set to 1 and ma set to candle 0. You have to set both to the same candle.

        Johannes

        1 Reply Last reply Reply Quote 0
        • 1 / 1
        • First post
          Last post

        Online Users

        E
        R
        F
        ح
        H
        J
        P
        B
        B

        22
        Online

        146.7k
        Users

        22.4k
        Topics

        122.6k
        Posts

        Powered by NodeBB Forums | Contributors