fxDreema

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

    Set Variable = Pips Lost

    Questions & Answers
    2
    6
    699
    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
      ForX92 last edited by

      HI,
      i need to set the variable "Diff" with the pips lost in last trade,
      my exemple:

      (On Tick)
      
             1st Column
      Once a day
      
      Condition = [...]
      
      Sell now 
                 TP = Variable3
      
      Modify Variables = 
                 Variable1 = Cancle, Candle 0 open
      
      
      
      
      
            2nd Column
      Once per bar
      
      If Trade exists = Sell
      
      Modify Variables = 
                 Variable2 = Candle,Candle 0 open
      
      Modify Variables = 
                 (Variable List)
                               Diff =  V1-V2  (Variable1 - Variable2)
      
      Modify Variables = 
                 (Variable List)
                               Variable4 = Variable3 + Diff
      
      Buy now
                  TP= Variable4
      

      But whan the EA run don't see the addition " Variable3 + Diff " , in my mind i want to create a variable = price lost with last operation + my take profit (costant)...
      How i can fix?

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

        Can you show me some project or screenshot of settings of the block where the problem happens (https://app.prntscr.com/en/index.html)?

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

          Of course!
          This is my project...
          http://i68.tinypic.com/icpgsk.png

          In this follow image i open all "Modify Variables" and i numerate it...
          http://i63.tinypic.com/j9afcx.png
          http://i65.tinypic.com/3025j43.png

          In alternative i tried to replace the "Modify Variables" with a "Custom MQL4 Code"
          http://i65.tinypic.com/3hmvc.png

          But the EA continues to set the "TakeProfit2" = "TakeProfit" ! Without the variable "DiffToT"

          P.S: the variable "Apertura" is this:
          http://i68.tinypic.com/29dh88.png

          Thanks for the quick response!

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

            In any case there are functions like Print(), Alert() or Comment() that allows you to see any value in different way, so you can check what is going on in this block.

            I don't remember problems in the "Custom MQL4 code" block in the desktop version. Now in the web version Variables are treated in different way, but in the desktop version they are direct and whatever you write in "Custom MQL4 code" should be put in the EA 1:1.

            What are you trying to do actually? Isn't it possible to get the value you want from somewhere directly instead of chaining these Modify block?

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

              By the way I just spotted something. In block 52 you have Diff = V7 - V5, which is this:
              Diff = Apertura - Candela1Open

              Then, when you replace this block with "Custom MQL4 code" you have it like this:
              **Diff = Candela1Open - Apertura **

              By the way you can use Apertura instead of V7 if this would be easier for you. These V* things are like this so we can write shorter formulas. The other reason initially was to allow us to rename our Variables, but now when Variable is renamed, it is also renamed everywhere in the code if it was manually written. Or at least this is the case for the web version, I'm not very sure for the desktop version!

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

                I resolved! Thanks for the swift response! 😉

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

                Online Users

                E
                R
                J

                15
                Online

                146.8k
                Users

                22.4k
                Topics

                122.6k
                Posts

                Powered by NodeBB Forums | Contributors