fxDreema

    • Register
    • Login
    • Search
    • Back to the main page
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    1. Home
    2. josecortesllobat
    3. Best
    J
    • Profile
    • Following 2
    • Followers 20
    • Topics 34
    • Posts 507
    • Best 41
    • Controversial 1
    • Groups 0

    Best posts made by josecortesllobat

    • RE: Why first trades on demo account does not get the right values?

      Hello @miro1360

      It looks that is working corectly on demo account as well.

      0_1546583689824_24f15781-1df9-4c29-80c4-f5c778101f97-image.png

      Thanks!!!

      posted in Questions & Answers
      J
      josecortesllobat
    • RE: HOW OPEN BUY OR SELL MORE THAN ONE?

      So, looking at your screenshot, I think that what you want is to open buys when MACD crosses above (x>) 0 and sells when MACD crosses below (x<) 0, right?

      Your conditions in the builder states to open trades when MACD > 0 (buy) &/or MACD < 0 (sell).

      0_1546633760846_2241e378-fb74-4173-be43-f14dcc52b6d5-image.png

      0_1546634278466_07217fc8-be16-456e-838c-ce6708ccb08b-image.png

      That condition is true while the MACD is above or below 0. So the EA will open trades for each time that the conditions are true.

      This could work if it is what you are trying to get

      0_1546634367564_f2804fc5-d45d-49dc-949b-64d33531f222-image.png

      0_1546634635867_f81e0f20-30c8-449f-9ea3-ff90b20f2beb-image.png

      posted in Questions & Answers
      J
      josecortesllobat
    • RE: ID 1 = 50% of ID 2

      0_1550475172618_37db727c-55d9-4f07-90d6-4e4a61913778-image.png

      Previous Candle is ID = 1

      You're taking the CandleOpen[2] and CandleClose[1]. It is not the CandleMiddleValue of the previous candle [1].

      posted in Questions & Answers
      J
      josecortesllobat
    • RE: How do engulfing ea?

      It is just a starting point guide. You can add or adjust blocks as you need.

      0_1550736319858_6335d47c-57b6-4952-af28-1ba2968bf40c-image.png

      posted in Questions & Answers
      J
      josecortesllobat
    • RE: Check age based on candles

      The easiest way is to define a variable that increases by 1 when a new candle opens if there is a trade running.

      int BarCounter = 0

      Once per bar - If trade -> BarCounter = BarCounter+1

      You have to reset that variable when there is no trade. My suggestion is to reset it when a new trade opens.

      This is just an example

      0_1553928120909_09a7492d-b945-40c4-b90b-59fa66c20cb5-image.png

      0_1553928394714_092a7b9b-da16-444e-a438-72d2e1566460-image.png

      posted in Questions & Answers
      J
      josecortesllobat
    • RE: Block "formula" with more operands

      You can use a "Custom MQL code" block like this

      0_1558547614237_028dd055-38a3-4a96-8b71-5edac0092712-image.png

      posted in Questions & Answers
      J
      josecortesllobat
    • RE: Condition than buy, keep the position till something happen

      Try this out

      0_1558848264199_684a7d19-ca49-4d12-ab00-6282325da22b-image.png

      posted in Questions & Answers
      J
      josecortesllobat
    • RE: Block "formula" with more operands

      Here you are defining a variable "Y1" as a result of an math operation. Then, "Y1" value will change in function of the variables "A", "X1" and "B".

      I am not sure what you mean with "Y1, A, X1 and B are changeable variables from other formulas blocks." "A", "X1" and "B" don't matter of where come. They might be a predefined variables or as a result of a formula block. But if "Y1" had a value before of that "Custom MQL code" block, Y1 value will shift to the result of the math operation.

      Y1 = 10
      A = 1
      X1 = 2
      B = 3
      Y1 = 1*2+3 = 5

      Before "Custom MQL code" block -> Y1 = 10
      After "Custom MQL code" block -> Y1 = 5

      Hope this helps.

      posted in Questions & Answers
      J
      josecortesllobat
    • RE: Block "formula" with more operands

      "Custom MQL code" should work with any math operation if it is well defined.

      Did you try it with an extra parenthesis?

      A=((Y1l-Y2l)/(X2l-X1l))

      ((A1+A2)/(A3+A4))

      I have used that block with equations more complicated than the one you are defining and it worked correctly.

      posted in Questions & Answers
      J
      josecortesllobat
    • RE: Block "formula" with more operands

      You can code what you need but you have to know how to use the math functions.

      https://www.mql5.com/en/docs/math

      Like

      0_1559054335100_11f4d42b-7280-4461-affa-933b448c0500-image.png

      posted in Questions & Answers
      J
      josecortesllobat
    • RE: Block "formula" with more operands

      Yes, you can.

      I would say that is this

      0_1559060155820_a252455a-4e10-4cfe-9db4-af5670a68a66-image.png

      But I have not tried it.

      posted in Questions & Answers
      J
      josecortesllobat
    • RE: 2 lost per day

      I would say that you need some project branches to get what you are looking for.

      bool StopTrade (variable to be modified depending on the conditions)

      Branch - 1 -> Conditions to trade will be checked out if StopTrade == false

      0_1575997686159_5cbd2318-73e7-47a4-93dd-7e835a0bf951-image.png

      Branch - 2 -> If a closed trade is a lose, then StopTrade == true

      0_1575997800811_f63ae771-c678-4cfc-a705-b6d2f5df16e9-image.png

      "For each closed trade" with n = 1 (newest to oldest) will load only the last trade closed. If the profit of that last trade is < 0 (lose), then StopTrade == true. With that, the conditions to trade will not be checked out anymore until the variable StopTrade become false.

      Branch - 3 -> Reset StopTrade for each new day

      0_1575998104573_a3db728b-6a2a-4c49-a129-38cf6069d5f5-image.png

      That could be an approach. NOT TESTED

      posted in Questions & Answers
      J
      josecortesllobat
    • RE: candle wick calculation

      You have all what is needed in some block like "Formula" one

      0_1576002332672_84cc73cf-19cc-45a5-88ea-ce38f692d124-image.png

      If you want to calculate the UpperWickPercent in respect of the Candle Total size, you just need to use the "Formula" block

      double UpperWickPercent
      UpperWickPercent = (Candle upper wick size / Candle total size) * 100

      posted in Questions & Answers
      J
      josecortesllobat
    • RE: en que estoy mal?

      @maty

      https://fxdreema.com/instructions/builder/things-not-to-do

      Es preferible usar la apertura de vela en lugar del cierre de vela. Ten en cuenta que una vela nueva empieza justo después que cierra la anterior. Por tanto, se puede decir que la apertura de vela nueva el lo mismo que el cierre de vela anterior.

      Entonces, del último proyecto que has compartido, prueba esto

      Bloque 1 (superior) -> "Once per bar" (el proyecto se ejecutará cuando abre una vela o, si prefieres considerarlo de esta forma, cuando ha cerrado la vela anterior)

      Añade los bloques de acuerdo a tu proyecto.

      0_1590388756291_ddfe2b46-74ef-442f-93e7-71fe1470d145-image.png

      De acuerdo a tus condiciones, estás comparando valores del indicador en la vela 1 (última) con la vela 2 (penúltima). Si son ciertas, se ejecutan los bloques siguientes.

      posted in Questions & Answers
      J
      josecortesllobat
    • RE: en que estoy mal?

      @maty

      0_1590428013785_118c0562-198d-4f64-b33f-5a32d73b0123-image.png

      0_1590428200857_7e8248d4-7e26-437c-b3b4-bad862ed99c6-image.png

      El bloque "No Trade" busca operaciones que cumplan los criterios seleccionados en él. En "Group Mode" tienes seleccionado "Group #". Sin embargo, no indicas qué Group # tiene que buscar el bloque y, por tanto, no encuentra nada que cumpla tus criterios.

      Prueba con

      0_1590428291676_5045b3d1-e87d-4c86-a786-297492d614c4-image.png

      posted in Questions & Answers
      J
      josecortesllobat
    • RE: Profit Math

      Hello @roar @AlphaOmega Happy to know that you were working on this and found a solution. Well done!!!
      Keep pushing on learning fxDreema and building your projects.

      posted in Questions & Answers
      J
      josecortesllobat
    • RE: Profit Math

      @AlphaOmega I have to say again that you must simplify the project as much as you can or we can try to help you step by step to build what you are trying to get from a simple starting point. Maybe this way is not quick but we can get a more understandable project behavior instead of trying to look at your code to see the trouble. I am sure that other forum members are smart enough to find the problem but the way that fxDreema explained to me is as I said above.

      Let's get started by doing a simple project. For example, I want that the EA opens a position every new bar after a bull crossover happened on the previous candle. There is no need to share your conditions to trade. After that simple project we will increase the complexity with what you want to obtain. What is important is to avoid adding more than 2 new features on each step of the project to be sure that what we added behaves as expects.

      posted in Questions & Answers
      J
      josecortesllobat
    • RE: Profit Math

      @AlphaOmega

      As I mentioned earlier, there are several ways to achieve the same result with fxDreema. This is just an option and, of course, the project can be optimized to get a more efficient code. Here it is the long trading side:

      0_1598856115194_309d9595-0ffe-4a5c-a22f-083ff1be7c8f-image.png

      https://fxdreema.com/shared/xblYjK0uc

      0_1598858539003_Profit Math.mq5

      0_1598857063028_095420a4-f777-4e71-a3b5-88fc8c9593e4-image.png

      0_1598857159633_91e6def0-2b3d-420d-b53f-af36d1c7457a-image.png

      0_1598857195997_16163e37-c5dc-4406-b3d7-def597666ac9-image.png

      Whatever the condition is true to enter at market, that piece of code will open a trade for every new bar with the original take profit value (100 pips in the exxample). When a child trade opens, it calculates the take profit average by getting which is the take profit in pips of the child trade using the parent open price as the reference following this formula structure:

      TakeProfitAv == (TakeProfitPips + (TPLevel_ChildTrade1 - OpenPrice_ParentTrade) "as pips")) / nTrades

      After that, the code will modify the child´s TP to TakeProfitAverage.

      That logic will repeat until you break the loop when your condition to do not enter long at market is met (maybe when start to go short).

      Keep in mind:

      • I defined the Pointsize with a number but it can be set with 'Market Properties'. This parameter is used to convert from points to pips or vice versa.

      • I have used a "Counter: Pass once' (Id=3) block to split the parent trade from the child trades. This block will need to reset at some point along your code. For example, when you break the go long loop. If it is not reset, when the EA starts with a new go long loop, it will not activate the true output of the block.

      One of the best suggestion that I got from fxDreema support & other forum members is to add blocks that makes me to see if the code is going as I expect:

      "Draw Arrow" allows me to see that the execution passed through the "modify stops" block
      "Comment (ugly)" allows me to see the parent trade values
      "Comment" allows me to see that the calulations are correct

      Hoping that this example provides you some starting point.

      posted in Questions & Answers
      J
      josecortesllobat
    • RE: Negative numbers

      Hi martin 1

      I guess that you use the "Search" tool of the forum to find interesting post that probably will answer your questions. For example, here you have a post explaining the "Adjust" field that is available in almost all the blocks

      https://fxdreema.com/forum/topic/4247/question-regarding-the-adjust-field

      0_1545061863082_353503f6-6f41-4850-968a-d5c12fd2cc77-image.png

      In addition to this, the adjust field has a "?" character. When you click over it, you will get some examples of what you can do with this field. For what you are requesting, you just write "*(-1)" without quotes in that field to get the positive number you need. In the example above, the ajust field calculates the 2% of the value of the constant "ProfitTargetM1_Sells" and the result is stored in the variable called "BEOffsetPips".

      You also can use the "Formula" block that allows to code from the basis of the math functions to more complex ones.

      0_1545062056461_788095a5-c926-43cc-bd16-ac0cf785ee48-image.png

      posted in Questions & Answers
      J
      josecortesllobat
    • RE: engulfing candlestrategy EA

      This is a pretty good starting point given by @miro1360

      https://fxdreema.com/forum/topic/4321/tutorial-08-candle-formations

      posted in Questions & Answers
      J
      josecortesllobat
    • 1
    • 2
    • 3
    • 2 / 3