fxDreema

    • Register
    • Login
    • Search
    • Back to the main page
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    1. Home
    2. jstap
    3. Posts
    • Profile
    • Following 2
    • Followers 222
    • Topics 37
    • Posts 9382
    • Best 1086
    • Controversial 23
    • Groups 0

    Posts made by jstap

    • RE: MT5 Close All Fast

      The 1st section (under settings) it is where the action code goes, I called it on tick for this but
      it depends on where the block is used.

      posted in Questions & Answers
      jstap
      jstap
    • RE: How to close all trades when running equity is grater than starting equity by $1

      Add a comment block, in the block right click and add the variable, under add the variable again adjusted by +1
      On screen you will see the difference

      posted in Questions & Answers
      jstap
      jstap
    • RE: گروه ساخت ربات و رفع اشکال زارع

      It shouldn't, do your trees start with a no trade block?

      posted in Questions & Answers
      jstap
      jstap
    • RE: Button that makes SL move closer to price

      @BrianaM1 👍It could move into a slight win, but on average a loss is more likely

      posted in Questions & Answers
      jstap
      jstap
    • RE: Button that makes SL move closer to price

      Yes because at breakeven price the close signal is sent, but by the time things close price may have moved into a slight loss

      posted in Questions & Answers
      jstap
      jstap
    • RE: How to close all trades when running equity is grater than starting equity by $1

      Put the result into a comment, this way you can see on screen when things should close

      posted in Questions & Answers
      jstap
      jstap
    • RE: Button that makes SL move closer to price

      If you set it to 0 it would try to close at breakeven, will likely cause a small loss though

      posted in Questions & Answers
      jstap
      jstap
    • RE: Button that makes SL move closer to price

      It is your choice, doing it that way should account for the total profit, but you have a chance that things like slippage will cause a loss

      posted in Questions & Answers
      jstap
      jstap
    • RE: Button that makes SL move closer to price

      various ways, condition block, profit < x.xx - close block

      This will check the combined total profit and close all

      posted in Questions & Answers
      jstap
      jstap
    • RE: Button that makes SL move closer to price

      Set a SL, or set a close trades when loss is too much

      posted in Questions & Answers
      jstap
      jstap
    • RE: MT5 Close All Fast

      I do not know, the link I put above compiles for me.

      You are using on MT5?

      Here is the code again

      on tick section:

      {
      startTime = GetMicrosecondCount(); // Record start time
      sTrade.SetAsyncMode(true); // Enable asynchronous trade operations

      CloseAllPositions();                // Call function to close all positions
      PrintPerformance(startTime);        // Monitor performance
      

      }

      In the global variables section::

      #include <Trade/Trade.mqh>
      ulong startTime; // To store the start time for performance measurement
      CTrade sTrade; // Trade object used for operations

      In the custom function section::

      void CloseAllPositions() {
      for (int cnt = PositionsTotal() - 1; cnt >= 0 && !IsStopped(); cnt--) {
      if (PositionGetTicket(cnt)) {
      sTrade.PositionClose(PositionGetInteger(POSITION_TICKET), 100);
      uint code = sTrade.ResultRetcode();
      Print("Close result code: ", IntegerToString(code));
      }
      }
      }

      void PrintPerformance(ulong startTime) {
      for (int i = 0; i < 100; i++) {
      Print("Elapsed time: ", IntegerToString(GetMicrosecondCount() - startTime), " microseconds. Open positions: ", IntegerToString(PositionsTotal()));
      if (PositionsTotal() <= 0) { break; }
      Sleep(100);
      }
      }

      posted in Questions & Answers
      jstap
      jstap
    • RE: THE QUESTION IS HOW TO MAKE THE VARIABLE : ‘delta_take_profit_money’ IN THIS EA TO BE AS “CONSTANT” SO THAT I CAN OPTIMIZE????

      @sktsec I do not know, but it sells constantly. Maybe it is dependant on the part of the world. Amazon are active in these countries: United States, Canada, Mexico, United Kingdom, Germany, France, Italy, Spain, Japan, Australia, and Singapore (probably more)

      I will have a look at how it could be bought otherwise, if people tell me there country they are trying to buy from I will see what I can do

      posted in Questions & Answers
      jstap
      jstap
    • RE: Placement of buttons and logos

      I think this would show on the common tab, but possibly would need created by another means.

      posted in Questions & Answers
      jstap
      jstap
    • RE: How to close all trades when running equity is grater than starting equity by $1

      Connect the blocks, the condition is how you had it set

      image.png

      posted in Questions & Answers
      jstap
      jstap
    • RE: Hello all, a quick question

      @sajjad3245 Your welcome

      posted in Questions & Answers
      jstap
      jstap
    • RE: Placement of buttons and logos

      There are a few things you need to do, creating the buttons is simple, on init draw button (named), with at least 2 blocks - on tick use then redraw

      on init create the picture, in the forum you will find ways people have done this

      posted in Questions & Answers
      jstap
      jstap
    • RE: MT5 Close All Fast

      To get this working in FX you need to create a custom block:

      I have done that here: https://fxdreema.com/shared/GVIxc5AZ. But I haven't tested it, so I don't know if it works. You will need to set the condition to activate it

      This is how I created:
      in the 1st section (on tick in this case)
      {
      startTime = GetMicrosecondCount(); // Record start time
      sTrade.SetAsyncMode(true); // Enable asynchronous trade operations

      CloseAllPositions();                // Call function to close all positions
      PrintPerformance(startTime);        // Monitor performance
      

      }

      In the global variables section:
      #include <Trade/Trade.mqh>
      ulong startTime; // To store the start time for performance measurement
      CTrade sTrade; // Trade object used for operations

      In the custom function section:
      void CloseAllPositions() {
      for (int cnt = PositionsTotal() - 1; cnt >= 0 && !IsStopped(); cnt--) {
      if (PositionGetTicket(cnt)) {
      sTrade.PositionClose(PositionGetInteger(POSITION_TICKET), 100);
      uint code = sTrade.ResultRetcode();
      Print("Close result code: ", IntegerToString(code));
      }
      }
      }

      void PrintPerformance(ulong startTime) {
      for (int i = 0; i < 100; i++) {
      Print("Elapsed time: ", IntegerToString(GetMicrosecondCount() - startTime), " microseconds. Open positions: ", IntegerToString(PositionsTotal()));
      if (PositionsTotal() <= 0) { break; }
      Sleep(100);
      }
      }

      posted in Questions & Answers
      jstap
      jstap
    • RE: How to close all trades when running equity is grater than starting equity by $1

      To save the EA starting equity add a pass block:

      image.png

      To close trades if equity is higher split the trees:

      image.png

      posted in Questions & Answers
      jstap
      jstap
    • RE: How to close all trades when running equity is grater than starting equity by $1

      What is saving the starting equity? Blocks under a no trade block will not work once a trade is running

      posted in Questions & Answers
      jstap
      jstap
    • 1
    • 2
    • 66
    • 67
    • 68
    • 69
    • 70
    • 469
    • 470
    • 68 / 470