fxDreema

    • Register
    • Login
    • Search
    • Back to the main page
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    1. Home
    2. cfabian
    3. Posts
    C
    • Profile
    • Following 0
    • Followers 0
    • Topics 18
    • Posts 53
    • Best 0
    • Controversial 1
    • Groups 0

    Posts made by cfabian

    • RE: self updating/refreshing grid, compare two groups of trades

      __cfabian, I didn't changed that block on the web version. Not to mention on the desktop version. If something worked before and now it doesn't work, and I didn't changed anything, I suppose that it's something that you have done. But I don't know what it is.

      For this block, note that this stuff 5.7 => 0.0 is generated inside the block every time it runs. If for some reason the block does not run all the time, this thing will not be updated.
      Also, I admit that there can be some problem inside the block, some bug. I'm fixing this one from time to time. Now I don't know what is the problem exaxtly, but if you give me simple example that contains 2-3 blocks and shows the problem when I put it into my MT4, I will fix whatever it is. I probably said this few times already :)[/quote:2vz8yxka]

      Thank you... looks like I have resolve it. Will let you know if not.

      posted in Questions & Answers
      C
      cfabian
    • RE: Calling values from other charts????

      Is it possible to call indicator values from an offline chart? How to link to different chart and its indicators and values?

      Thanks

      posted in Questions & Answers
      C
      cfabian
    • RE: self updating/refreshing grid, compare two groups of trades

      __These options are similar to the same in the regular trailing stop. Trailing stop mode = where to place the stop, Trailing Stop = how often to modify it. Yes, the step can be 0.

      When I first made this block, it was with horizontal line. But then I modified it a little bit and now it draws these numbers. What they mean is that when the profit becomes 2.52, trades will be closed, but now the profit is 5.1. In other words: Current Profit => Trades will be closed when the profit becomes this. These numbers comes from the block, MT4 itself does not have such options.[/quote:2xkpj4n8]

      I've been using this trailing money loss, and it worked fine when I first used. Now I don't know why, at all times when reaching start value, and profit climbing the value on the right doesn't change. It remains like say 5.7 => 0.0

      2 days ago I saw it working and the value on the right kept changing as profit increased. Now I don't know why it does not change 0.0 value.

      I have used as a step values like 0, 50 and 100. But unsure which one is more adequate, or how this really works. My need is that if profit increases no matter by how much, the SL always be at 70% of the maximum gain, meaning I'll give up 30% of the profits.

      Please help on how to set up step value to make it work as described.

      Also have to say that at some trades I don't get the 5.7 => 0.0 Prompt, no matter profit was over start value. Any guess?

      Thanks

      posted in Questions & Answers
      C
      cfabian
    • RE: Project variables are getting reset

      __Hi, this is my first attempt at building an expert. I am facing a problem while running my expert in a demo account. It seems that whenever I stop Autotrading on my MT4 platform and then turn it back on, the expert goes to it's default setting i.e., all the project variables get reset to the default. Here is the link to my project,

      https://fxdreema.com/shared/7GQWEhe3e

      Can you please help me with this issue? Thanks in advance.[/quote:tu24itif]

      I believe this is a normal condition, as the calculations are stored in a temporary memory I belive, and not hardcode written.
      What variables are the ones that shouldn't change and why?

      posted in Questions & Answers
      C
      cfabian
    • RE: Basket take profit and profit retrace workaround

      __Please, go to the examples and check those blocks - the purple "bucket" blocks and pink "for each..." blocks. There are some examples and each example have description.
      In short, "For each... " blocks are used when you want to iterate throuhg trades, one by one, and do something with each one of them.
      "Bucket" blocks are to be used when you want to get value (min, max, averate or total) out of a group of trades.

      "Check profit (unrealized)" does everything inside - loads trades, collects data and checks the result.

      Also check how to work with Variables. You can define as many variables as you want and modify them as you want. This is low level stuff and I will always recommend to not use Variables (at least not too many of them), but I will not add such functionality to collect profits over time.

      What is the idea. If you have variable named "MyVar", then on each tick calculate the total profit and if the total profit is > than the value of MyVar => set the value of MyVar to that profit. This is simple. What is not simple is when to reset the value of that variable, because you have trades that will be closed and trades that will be opened. It sounds boring, but it depends.[/quote:29srlbfe]

      Hi there,
      Iยดm now having issues with writing my custom variable. The reason is that I cannot find how to pull out the value of the "Check profit (unrealized)". When you work with formulas, you can set it to write the value of the calculation into a variable. I can see that in the block, you can edit variables as well. Attached an image, from which my guess is that the value of "compare" (or P11) is the value of current unrealized profit. So, will I simply put P11 in the orange field of my variable?

      Now, how to call custom variables from formula block? As in terminal variables, it clearly says "This is NOT for variables"

      I suggest to review how your "trail stop group of trades" block works. It really has flaws when using it real time.

      I found the block "trailing money loss group of trades", that my understanding is that it DOES keep record of the maximum profit from a filtered group of trades, and this may work out for me as well.

      Many thanks for your help as always

      EDIT: Following the image here, I set P11 in the orange box as drawn, but got a compile error. 'Compare' - Undeclared identifier

      {
      v::MAXProfitBuy = Compare;
      block98(103);
      }

      ......
      variables.jpg

      posted in Questions & Answers
      C
      cfabian
    • RE: Basket take profit and profit retrace workaround

      __What's wrong with "Check profit (unrealized)"? The idea of this block is to check the current porofit from a group of trades.

      Max value - this is the the biggest profit at the moment, the profit from a single trade that has the biggest profit, the profit from only one trade. This is not the max. profit reached so far, there is nothing to collect such information[/quote:1epben0h]

      Will try check profit unrealized block. I thougt max value refered to what I needed. So, in this case I need to use it instead if blocks 1,2 and 4?

      Purple basket block is needed there?

      All other blocks and connections are OK? Well structured?

      Formulas need to be connected as I did?

      I understand you have no block to count max profit achieved at a time (watermark). What would be your suggestion to create such functionality?

      Thanks

      posted in Questions & Answers
      C
      cfabian
    • RE: Basket take profit and profit retrace workaround

      Hi again,
      I've decided to create a workaround the the basket trail SL as the block is not working as expected.
      I have the following settings up, but is not working either. Maybe because I'm missing a piece of the pie as I need some formulas to do so.

      Attached an image of my "basket stop system". What is planned to do is the following:

      • I have divided a basket for buys and a basket for sells.
      • Call the open trades by group (buys or sells)
      • Have a close condition of the trades when profit of each basket is over $100, by using a condition conected to the purple block, in which I ask for "profit" -> "total value" and if is over 100, then close open and pending trades.
      • Same thin as above, but use a loss of -$50, to that if the loss of the basket exceeds that, it closes open and pending orders.

      Then, I have another system which intention is this:

      • Activate it when profit of the basket has reached $20
      • After activation, at all times calculate the maximum profit reached so far (so I select "max value" from the "value to get")
      • Set a value of 70% of maximum profit as the SL for the whole basket. I calculate this with the formula "max value" x .7, and then store this value in a custom variable, that will be used for calculation in one condition block.
      • If profit reaches 70% of maximum profit (water mark), then close all open and pending orders.

      As you can see, I've worked with this model, but cannot make it work (none of the 2 functions I want) as not sure if I'm missing something, or have wrong connections or blocks. Also not sure if formula blocks should be connected to something.

      I appreciate very much your help. This functionality is what I was expecting from trailing stop group of trades, but is not working for me.

      I see that in attibutes and values of conditions I cannot use pips, so instead I use money.

      Here is a link to the system in this example:

      https://fxdreema.com/shared/3LdYKtLWb

      Many thanks for your great help

      ......
      basketstops.jpg

      posted in Questions & Answers
      C
      cfabian
    • RE: Closing bucket of trades

      __Check profit (unrealized) - Close trades[/quote:hb2teys2]

      You mean same way I have it but dropping the purple box? I'm working with a group of trades, not just one.

      What about if want to have separate process for buys and sells, so that when closing when in desired profit, it closes pending orders as well?

      posted in Questions & Answers
      C
      cfabian
    • RE: Closing bucket of trades

      Thank you... but "for each trade" does not help, as I want to check profit of my basket of trades. If profit is at desired level, then close the trades.

      What block you suggest to use instead for the whole group, not for each trade?

      __I made "Bucket" blocks for people who want to get some calculated value, like the sum of all profits or similar stuff. These blocks only create a list of trades and that's all. Then, in Condition the value is calculated. Min, Max, Total or Average balue. These blocks has nothing to do with pink blocks. Pink blocks work in this "for each" manner. For pink block use one of the "For each..." blocks above. There are some examples here - LINK[/quote:3nfcua6u]

      posted in Questions & Answers
      C
      cfabian
    • RE: Closing bucket of trades

      I'm trying to set a funtion that closes my group trades after a profit is reached.

      Used purple block, "bucket of trades" for nuy and one for sell orders, then linked to "check profit" pink block, and then this one linked to pink "close" block.
      The check profit is true when profit is = or greater than the amount I want, but it is not working. Also included a block to close the pending orders when closing the active ones. Attached image.

      I wonder if these blocks should be connected to any other one to pass, or how to make this work?

      Any other idea to close group or active and pending trades of one group, after a profit is reached?

      Thanks

      ......
      buckets.jpg

      posted in Questions & Answers
      C
      cfabian
    • RE: Break even for a group of trades

      I've revised all the blocks with group condition, and all are good with their respective 1 and 2.

      I understand about the start parameter, what I'm saying is that some times is not working, no matter is set to 10, I had a couple of times with profits of around 20, but no SL was made in place.

      Now, you suggest that for having a group of trades at BE when profit reaches start value, we should use that same start value in stop. But this is not happening as it places a SL at a real loss value. Will compile again my EA after your change and see if it works. Same thing for the trail SL.

      Thanks

      __When you work with the Group parameter, you must be sure that in all trading blocks numbers are correct. By trading blocks I mean all blocks that can create, modify, delete trades and orders, or simply check something about them. You can try with "1,2" as a Group number in the TS block.

      The problem with this "-10 pips loss" was because the update I made last time when I decided to use the avetage price instead of the current price. I reverted this now... I'm still not sure which is the right price to be used in this situation.

      About the initial modify of SL... well, it looks that this happens once when the Start price is reached. There must be a reason why this parameter is called "Start" ๐Ÿ™‚

      I'm doing my tests in EURUSD and with 10-15-10 settings everything looks fine for me, SL is modified from time to time.[/quote:lvpaio6d]

      posted in Questions & Answers
      C
      cfabian
    • RE: Break even for a group of trades

      I think I have some advancements here after soooo many tests.

      The "trail stop group of trades" option is starting to make changes ONLY if I select "all trades, automated and manually"

      Now, I see that when having pending orders in the chart, it does different calculations. I believe it considers them, while to my point of view it should only calculate the values of real open trades.

      Now, I also see that when new trades open, the SL does not modify, no matter I have the "reset stop option when new trade" turned ON. It does modify after price advances more.

      I believe this block has some flaws. My appreciation is that many times it takes long to do calculations. For example, I have test settings in a demo account for "real time test", as follow: Start 10, stop 10, step 15. After overall profit is at 10, the SL gets modify to a value that is a net of -10 loss if hit. Not to a breakeven value as you suggested at the beginning of this thread. But what concerns me the most, is that in some ocasions, do not why, no matter profit is at around 20 (way after the start point of 10), I get no modifications whatsoever.

      As per the SL moving after price continues and profit moving in increments equal to the step value, this is not moving. I have some open trades with profit over 60 pips, and the SL remains in a value that can incur of a net loss of -35. When it should have locked some 40 pips at least.

      • EDIT - By now these trades are at +200 and SL remains at the same point, for a net loss of -35. It is not doing the step thing.

      So, to me there is some bug in there, and calculations are not fast nor accurate.

      I'll appreciate very much if you can dig in the code to see what is going on and fix it. This is the link of the trail EA test:

      https://fxdreema.com/shared/F9yOFTWqc

      Many thanks for your help and support

      __This error appears after request, I believe. It's not like error that the EA is giving before even trying to communicate with the broker. You can count your requests to the server. I only think that this error has nothing to do with the EA itself[/quote:14lll8ln]

      posted in Questions & Answers
      C
      cfabian
    • RE: Break even for a group of trades

      Well, it looks really odd, as they aren't really too many trades to modify, something around 3-5, and SL value is not close to the gap required vs current price. Makes no sense, but understandable if were many many trades.

      __Well, I think this error is self explanatory. I guess you are testing this on live demo account. At least I don't have US30 in my Tester, but I have it as a symbol for live. If the EA can't do something, it woud try again and again, which is probably not the best thing to do in case of such error. But what to do? Learn the limits of your broker and don't break them, this is what sounds to be the right answer.

      If there are too many modifications, Trailing STEP can be raised to make them rare.

      For the "group" TS, it depends what the initial stops are. If there are no stops they will be created. If they are shorter than STOP... it depends on the option I added lately. But try it. Even I have to try something to remember how it's working. I don't work with this particular block very often. I also tend to be confused about the Trailing Stop stuff even when I'm working with it actively :)[/quote:uzoi8at3]

      posted in Questions & Answers
      C
      cfabian
    • RE: Break even for a group of trades

      Okay, I created a simple EA for basket trail that created several orders as price continues its way, and also one that only handles one SL condition. See the link below.

      https://fxdreema.com/shared/ZewcqjOD

      The EA is not doing the SL modification, however I saw this message in the log, that have no clue on how to deal with this kind of errors in case it was originnated by the trail function. By the way, the basket of trades does not exceed 10 trades, but at the beginning it should work with 3-4 trades as they start piling up. The start trail is 20 pips (2000 with my broker).

      The error is this:
      2016.05.18 14:23:58.303 trailtest3 (4) US30,M2: Modify error: Too many requests (141)

      Any other clue on how to tackle this? The trail stop for basket trades is what is missing from my strategy.

      By the way, the basket trail stop is used as the initial SL for the whole trades of the basket?

      Thanks again for your help

      __Look, I am a simple stupid guy, my mind is weak. I was answering to question from different people for the last few hours and I'm not finished. I don't remember what happened in my own life yesterday, I can't remember people's problems with details. And I remember that I explained everything about Trailing stops and Break even and I also told you multiple times to put 2-3 blocks in an empty project and try how something works. I'm lost in this topic already. I don't know what "cannot make it work" means at this point. My native language is also not english, so I often misunderstood what people are saying to me. What I can suggest is again, make a very very, I mean very simple EA that has 2-3 blocks and shows the problem, whatever it is. You can make screenshots (Lightshot is amazing program) and show me what exactly is not working. When I see the problem I will fix it in minutes, but if I have to dig into people's projects searching for something that is decribed as "cannot make it work"... I just can't, I surrender.[/quote:1wy307ha]

      posted in Questions & Answers
      C
      cfabian
    • RE: Break even for a group of trades

      Thank you. So you fixed the reset on new trade then? What should I do? Simply download again the mq4 file and run again?

      I've tested group trailing in many differnt ways and I cannot make it work. Maybe a bug there?

      __Ok, I believe I fixed the reset.

      So, how this block works. Virtual average price is calculated and it depends on the lot sizes. If you have 2 trades with the same lot size opened at levels 10 and 20 for example, then their average price is exactly in the middle - 15. But if one of the trades has bigger lot size, then the average price is closer to that bigger trade. SL is calculated from that price.

      When a new trade is opened (or some trade is closed), the average price in the group changes... obviously... because there is new member in the group. If "Reset the stop on new trade" is set, then when a new trade is opened the SL is put at TrailingStop distance from the current price. Now I'm not sure that this is the best behaviour, because it looks that if you open new trades too often the SL line moves away from the current price and it's hard to reach it. But how it should be anyway :)[/quote:4dl0gfig]

      posted in Questions & Answers
      C
      cfabian
    • RE: Break even for a group of trades

      Will try to do more tests.
      My blocks I see them blue, not purple. They are part of the "trail stop/break even" section.

      You even used them for explanation in "on tick" as well with this link: https://fxdreema.com/shared/F5FBQ3avc

      So, which is correct?

      Can you please also try to explain with more clarity how to use % of trailing stop?

      This is what I understand from the settings in this block:

      • Trail start - Is the amount of pips in positive there is from a particular pair at which the trail starts to operate. For example 50. When profit is 50 pips this is activated.
      • Trail stop - After trail start is reached, trailing function is activated, and this Is the amount of pips behind trail start at which the first stop is placed. If have 37 and have 50 in start, then when I have 50 in profit, I lock in 13 pips as is the difference between 50 - 37.
      • Trail step - When profit continues growing, this is the amount of pips profit should grow before moving the SL again, and the SL moves by the same amount. For example, step 15, and continuing with the same example, when profit is 50 pips, then the stop for all trades moves to such level that I lock in 13 pips, and when profit reaches 65, then my SL moves again to a lock profit of 13 + 15. Then SL will move again at 13+15+15 when ptofit advances another 15 from 65.

      Not sure about this but:

      • The amount in trail stop is used as well as the loss we are willing to take for the whole basket of trades. Can be used as the initial SL for all trades.

      Is my all appreciation correct?

      Thanks again

      __I think I explained everything, I don't know what else to say. Make one simple EA and try each block alone.

      I can see you use purple blocks for the Trade event. These should be used under "on Trade". I don't know what would be their behaviour under "on Tick"[/quote:18ji9qv3]

      posted in Questions & Answers
      C
      cfabian
    • RE: Break even for a group of trades

      Trail step is 30%, so again not sure what is the problem with stop vs step. Does this work as I assume (30% retrace from maximum water mark to close)?

      Is not that values are huge. It is a decimal thing with the broker. 1900 means 19 pips. Nothing else.

      __Again, your Step values are HUGE. I would not expect a Trailing block to behave as such when the Step option is bigger than the Stop option. What else can I say... I even posted an example. Well, not the same kind of values, but it works for EURUSD.
      Just do things one by one. Connect a block - test. Connect another block - test. Don't put 10s of blocks expecting that everything will magically work, it's so much harder to see what is really going on this way.[/quote:2pn11062]

      posted in Questions & Answers
      C
      cfabian
    • RE: Break even for a group of trades

      Thanks for your constant help... really appreciated.

      I still have issues. First removed the group numbers from trades, but then started to have problems on the close trades functionality. For a reason it didn't remove all pending trades qhen the condition was met. It was weird as all pending orders come from a grid. Really unsure why. So, I decided to put group numbers back again, and it is now closing trades according to the condition flawlesly.

      Now, still not able to make BE and TS for group of trades work. I have them set to BE when from each group trades are at 2000 pips in profit. This is not working... it has worked in situations when profit is at around 8000, after all pending trades from the grid I set are triggered, but not all the time, as I was closely looking at a group of trades, and they were over 9000 and didn't move the SL. I don't believe pending orders have an effect on this, but it simply does not set the SL to BE after the 2000 pips, where also I assume should be recalculating the SL at BE every time a new trade gets triggered.

      For trailing block, trailing start is at 5000, bigger than the one for BE (which is 2000). Trailing stop is also at 5000, and same thing at 2000 for BE (same values in both variables in its corresponding block), I have set trailing step at 30%, that according to my understanding, it should close all the trades when profit is reduced by 30% from the max watermark. But is not.

      I'm banging my head with this really.... hope you can help further. Many thanks

      __If you have 2 or more trades, then TS keeps their SL the same. 30 pips below Ask for each trade. Lot sizes does not matter.

      If you want to move SL depending on the group profit of all trades, which depends on their lot sizes - then there is another type of TS block - Trailing money loss. I tend to always forget how this one works :)[/quote:sjp45nxj]

      posted in Questions & Answers
      C
      cfabian
    • RE: Break even for a group of trades

      Thanks for your input.
      I have eliminated the group numbers in the blocks. Let's see how it behaves.
      As per "No trade/order" before buying and selling. Max 1 Buy and 1 Sell, or 2 trades."... yes this is part of the project for simplicity. I have a set of conditions after "No trade/order" and before buys and sells. My trades are openning well accordingly, my issue being the SL, BE and trail.

      Other than that, connections for SL, BE and trail are correct? Will let you know how it works after eliminating group codes and going only by type (buy or sell).

      What is your observation on why the trades are not closing when time is out of time filter?

      Thanks a lot

      __Another issue. You have "No trade/order" before buying and selling. Max 1 Buy and 1 Sell, or 2 trades. There are no groups in this case. I think you are showing me the wrong project ๐Ÿ˜•[/quote:2mey2yoz]

      posted in Questions & Answers
      C
      cfabian
    • RE: Break even for a group of trades

      Been studying and playing around with this, but still lots of confusions. My system is now all depending on the SL and BE, and really need your input here so I can move forward.

      Look at what I have configured so far. Attached link.

      https://fxdreema.com/shared/No9MkdlWb

      The explanation of what I pretend it to do is this. (please dont mind about decimals, as my broker uses this big numbers for CFD):

      • If I have open trades, check the number of open trades.
      • If open trades are less than 3, then each of the trades will move to BE when profit of each is over 90 points.
      • If have 3 or more open trades, it will move to BE the whole basket when 2000 pips (sum of all trades) in profit.
      • If have more than 5000 points on profit, start trailing stop at 30%.

      What I see so far is this:

      • None of the trades move to BE when reaching over 90 in profit.
      • Some times it moves SL of the basket to BE, but not when reaching over 2000, even way over that, 2 or 3 times fold, and do not move them to BE stop. Haven't got when it is moving that BE when it does.
      • At the top of my EA, it checks for time. I have a link to close all open and pending trades when time is not in my trading hours, but this is not closing anything at all.

      Can you please check this and help? Maybe there are some other avenues to do what I want.

      Many thanks again

      __What I don't like in the screenshot is the size of Step. I said this before, but Step is normally lower than Stop. It can be bigger of course, but the you don't have normal Trailing anymore.

      I also said that Trailing Stop block can be used to make it work as Break Even. I think the configuration was something like this - Step is some giant value that never will be reached, Start is the profit that must be reached, Stop is equal to Start (or lower). Like this - https://fxdreema.com/shared/gaJnbwWY
      It looks a little bit like this in the screenshot and because of that I giess that you have some SL movements that look like break even, but not real trailing stop frequent movements. Again, this is because of the Step size.[/quote:3fmzsy8o]

      posted in Questions & Answers
      C
      cfabian
    • 1
    • 2
    • 3
    • 2 / 3