fxDreema

    • Register
    • Login
    • Search
    • Back to the main page
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    1. Home
    2. Radar
    R
    • Profile
    • Following 0
    • Followers 0
    • Topics 0
    • Posts 5
    • Best 0
    • Controversial 0
    • Groups 0

    Radar

    @Radar

    0
    Reputation
    225
    Profile views
    5
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    Radar Unfollow Follow

    Latest posts made by Radar

    • RE: Objects are not deleted

      That was what I meant, yeah, but I was off the mark 😞
      The arrows for trades are created by the OrderSend() function of mt4, and cannot be deleted 😞
      You can prevent them from being created when the orders are sent by setting the final parameter of OrderSend() to CLR_NONE, (or by simply deleting the color parameter) (see https://docs.mql4.com/trading/ordersend for the format of the OrderSend() command).
      Sorry for the mis-direction 😞 I've been coding in mql4 on and off for around 4 years, and have always used a function written by someone else to send orders (it has a few extra checks before and after OrderSend()), so I always thought that function drew the arrows.

      Have fun!
      Radar =8^)

      posted in Questions & Answers
      R
      Radar
    • RE: Modifying pending orders?

      Hey Adrianbialkowski,

      Move the block(s) to the "On Timer" section, then go to "Options -> Current Project Options -> Timer Event Period" to set the frequency.

      Have fun!
      Radar =8^)

      posted in Questions & Answers
      R
      Radar
    • RE: Objects are not deleted

      Hey Isp00rt,

      Check out the block "For each Object". Expand "Filter by Type", and for "Object type" select "Arrow" from the drop-down list...
      Connect the "Delete" block to the "For each Object" block.

      Have fun!
      Radar =8^)

      posted in Questions & Answers
      R
      Radar
    • RE: count consecutive stop loss

      Hey Alexdepa,

      I still can't do this in fxDreema, but I can give you some snippets of code that will do the job...

      I'll assume that you're using a global scope variable named "ConsecutiveSLCount" for this... Replace it with the name that you actually use...

      In init...

         if (GlobalVariableCheck(StringConcatenate(<EAName> + "_" + Symbol() + "_" + string(Period()) + "_ConsecutiveSL_"  + string(<MagicNumber>))))
         {
            ConsecutiveSLCount = GlobalVariableGet(StringConcatenate(<EAName> + "_" + Symbol() + "_" + string(Period()) + "_ConsecutiveSL_" + string(<MagicNumber>)));
         } // End if (GlobalVariableCheck(StringConcatenate(<EAName> + "_" + Symbol() + "_" + string(Period()) + "_ConsecutiveSL_" + string(MagicNumber))))
         else ConsecutiveSLCount = 0;
      
      

      Obviously, replace <EAName> with the name of the EA, and <MagicNumber> with the name of the constant that holds the Magic Number 😉

      Now, just after the point where you update the counter, paste this bit of code...

         if (ConsecutiveSLCount >= 1)
         {
            GlobalVariableSet(StringConcatenate(<EAName> + "_" + Symbol() + "_" + string(Period()) + "_ConsecutiveSL_" + string(<MagicNumber>)), ConsecutiveSLCount);
         } // End if (ConsecutiveSLCount >= 1)
         else
         {
            if (GlobalVariableCheck(StringConcatenate(<EAName> + "_" + Symbol() + "_" + string(Period()) + "_ConsecutiveSL_" + string(<MagicNumber>))))
            {
               GlobalVariableDel(StringConcatenate(<EAName> + "_" + Symbol() + "_" + string(Period()) + "_ConsecutiveSL_" + string(<MagicNumber>)));
            } // End if (GlobalVariableCheck(StringConcatenate(<EAName> + "_" + Symbol() + "_" + string(Period()) + "_ConsecutiveSL_" + string(<MagicNumber>))))
         } // End else
      

      Again, replace what needs to be replaced.

      Now, as the EA runs and consecutive SL's are counted and the global-scope variable is updated, the GlobalVariable of the terminal is also updated...
      You can shut down the terminal at the end of the week, and when you re-start next week, the code in init will read the GlobalVariable of the terminal, and update the global-scope variable with its contents.

      Have fun!
      Radar =8^)

      edit... I forgot to say that the EA name must be in double quotes.

      posted in Questions & Answers
      R
      Radar
    • RE: count consecutive stop loss

      Hey Alexdepa,

      If you want your EA to remember state information (e.g number of consecutive trades that closed at a loss), you will have to either save that information to a file and read it back as required (and on restarts of mt4), or save it to Global Variables of the terminal (and read it back).

      I have no idea how to do either within fxDreema, as I started playing with it about 4 hours ago 😉

      Not much help, I know, but it might point you in the right direction.

      Have fun!
      Radar =8^)

      edit... I had a quick look, and found "Write To File" in the "Communication" group, but couldn't find a "Read From File" option.

      posted in Questions & Answers
      R
      Radar