fxDreema

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

    Logic Issue with pips away from TP block

    Bug Reports
    2
    4
    865
    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.
    • K
      kroghd last edited by

      Hi,

      I think there is a problem with the block pips away from TP

      It will not take profit correctly on a buy order - I tried with many percentages from 50 to 150.

      I think the error is with the line in your function:
      if((attrTakeProfit()-ask())>=toDigits(PipsAway)) {GoToNext=true;}

      I think it should evaluate as less than or equal to - because most of the time the order always evaluates as more than PipsAway - And we only want this block to continue if it has just reached a little less than the pips away from TP.

      I havent tried with the sell type - perhaps there is a logic issue there also?

      Thanks

      -David

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

        I updated this block a little bit, to not pass if there is no TP on the trade or if there is no SL when % of SL is used, but otherwise I think that it's working correctly. What is the exact situation that you have, some simple example, screenshot, something?

        1 Reply Last reply Reply Quote 0
        • K
          kroghd last edited by

          Please see the picture.

          The trades I test with do have stop loss set.

          The line of code in your function currently its:

          if((attrTakeProfit()-ask())>=toDigits(PipsAway)) {GoToNext=true;}

          If I make it:
          if((attrTakeProfit()-ask())<=toDigits(PipsAway)) {GoToNext=true;}

          With the modification it seems to take profit at 50%, 60%, 70% away from the TP price (depending on setting).

          Without changing your code in my testing (depending on the percentage value) on a buy order it will take profit really soon (actually at a loss) or sometimes never take a profit - depending on the percentage value.

          Please let me know if you cant duplicate the issue & I will setup a new project and share it with you.
          tp_percent.png

          Thanks
          -David

          ......
          tp_percent.png

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

            Well, I updated the web version. Additionally, I reuploaded the local version with this fix, but my updates does not affect older local versions that somebody have... the local version has it's own local database 🙂

            Pips away from TP - means, that it detects when the price is at some distance from TP. For Buys, this is when the price moves down at some distance from TP. The current price for Buys is used to be Ask, so the formula you show obviously operates with Buys. Then when we do TP-Ask, because TP is above ask, the result will be positive and we are serching for that. The opposite Ask-TP will be negative and... not the one we are searching for, because on the other side we probably have positive value (if PipsAway is positive).

            Get the local version that I reuploaded or try it on the web. At least I can see what are you doing on the web.

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

            Online Users

            H
            G

            9
            Online

            146.7k
            Users

            22.4k
            Topics

            122.6k
            Posts

            Powered by NodeBB Forums | Contributors