fxDreema

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

    CRUDE NNFX ATR MODIFIER FOR STOP/PROFITS

    Tutorials by Users
    1
    3
    750
    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.
    • F
      FRAZ last edited by

      NNFX ATR MODIFIER

      If you are looking to calculate your risk and profits using the ATR and want profit and stop orders place when you buy this is how you accomplish it

      Notes:

      MAKE SURE YOUR CANDLE ID IS SET TO 1

      Other code:

      double ATR = (iATR(NULL,0,14,0)); // TELLS THE ATR OF THE 1H ADDED TO THE BID
      double STOPLOSS = ((Bid - ATR) +0.00001);
      double TAKEPROFIT = ((Bid + (ATR*5) +0.0000);

      P.s only took me about 35 versions

      FRAZ

      clickable example link
      https://fxdreema.com/shared/FDHljQ39b

      F 1 Reply Last reply Reply Quote 0
      • F
        FRAZ @FRAZ last edited by

        @fraz

        CLARIFICATION

        This will set your STOP/PROFIT TARGETS to the previous candles ATR range ONLY at the time of contract purchase.

        This will not update and is not a trailing stop. This is a Fixed OCO Order.

        Math:
        Purchase price - ATR value = STOP
        Purchase price + ATR value = TARGET

        example:

        1.0000 - 0.0063 (63 pips) = 0.9937 (STOP ORDER)

        1 Reply Last reply Reply Quote 0
        • F
          FRAZ last edited by

          UPDATE:

          Messing around with formulas and variables to create a "shadow order." for ATR. Due to experiencing an issue of not being able to only sell a partial order from the hard coded "takeprofit". want to sell a portion at 1x ATR to lock in profits and move stops

          will update with what i find later.

          Theory: you can use formulas to update variables to create "shadow orders" that "on tick" check the current price to see if there is a BOOL value to execute an order.

          FRAZ

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

          Online Users

          D
          E
          M
          H
          C
          I
          I
          E

          23
          Online

          146.6k
          Users

          22.4k
          Topics

          122.6k
          Posts

          Powered by NodeBB Forums | Contributors