fxDreema

    • Register
    • Login
    • Search
    • Back to the main page
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    1. Home
    2. fxDreema
    3. Posts
    • Profile
    • Following 0
    • Followers 691
    • Topics 32
    • Posts 7485
    • Best 277
    • Controversial 18
    • Groups 1

    Posts made by fxDreema

    • RE: Open and close

      By the way you can always test live on smaller timeframe where things happens much quickly, for example on M1. There is no reason to wait 4 hours if you can wait 1 minute (or 5-15 minutes if 1 minute candles are too small) 🙂

      posted in Questions & Answers
      fxDreema
      fxDreema
    • RE: Open and close

      If something works on backtest and not love, then the first thing to see is if there are error messages.
      But I think it's something else. You are saying this:

      __
      But when going live it closes trades on new bars which it doesn't do in the tester.[/quote:1d19hf59]

      This probably means that your trades are closing right when a new bar opens, without any other condition. Can you check if there is another EA currently working on another chart, some EA that you forgot working?

      posted in Questions & Answers
      fxDreema
      fxDreema
    • RE: Open and close

      I don't understand what is the problem - trades are closed when no need to, or trades are not closed when need to?

      I will suggest to use "No trades...." blocks instead of these counters.

      posted in Questions & Answers
      fxDreema
      fxDreema
    • RE: Open and close

      You have connected "Close each trade" right after "Buy now" and "Sell now".
      When "Buy now" or "Sell now" creates it's trade, it continues to the orange output and what can be found there... "Close each trade". So, the result is that a newly created trade is immediately closed.

      If you want to close trades after another condition, place "Close each trade" on a different group of blocks with that condition.

      Also, instead of "Counter..." blocks, you can use blocks from "Manage trades/orders count" category.

      Don't test on live real account. First test on Strategy Tester (Visual mode is a good option), then on demo account... and if everything is fine for sure - on real account.

      posted in Questions & Answers
      fxDreema
      fxDreema
    • RE: Simpler Way Than Using 8 Blocks?

      Every EA is working for it's own on it's chart, it's independent, no matter if it comes from the same .ex4.

      posted in Questions & Answers
      fxDreema
      fxDreema
    • RE: Simpler Way Than Using 8 Blocks?

      Oh damn, this option is not present in Trailing stop blocks... it's only level and pips over there...

      Do you really try to create some kind of universal trailing stop EA?

      posted in Questions & Answers
      fxDreema
      fxDreema
    • RE: Control of trades, new trades and add to volume - help!

      Do you try to do something like this? http://fxdreema.com/shared/1LVMmIh7 (it can be made with less blocks using variables, but I'm leaving it like this to show all the steps as independent)

      posted in Questions & Answers
      fxDreema
      fxDreema
    • RE: Control of trades, new trades and add to volume - help!

      "Check the distance between two levels" block has nothing to do with trades, it just calculates distance between two levels, no matter if they belong to trades, objects, or manually written values.

      This is something that I wrote hundreds times before, but when using "(in loop)", "Start 'whatever' loop" block should be used - there it is decided to which trade these levels (op, sl) belongs to.

      posted in Questions & Answers
      fxDreema
      fxDreema
    • RE: Simpler Way Than Using 8 Blocks?

      You are trying to make universal EA that recognizes X-digits brokers, but actually fxDreema also does that using "Point format" in project options and this function:

      http://fxdreema.com/documentation/colle ... 4/pipvalue

      Now, function like this helps when EA works with basic currencies where digits are 5 or 4. But non-currencies are more complicated. You can find the same instrument with 1 digits in one broker and 2 digits in another. You can actually find USDJPY with 3 digits in one broker and 2 digits in another! And for non-currencies... it's hard to say that they have "pips".

      So I have to make it possible to define custom settings for every market. Well, I'm not gonna do this right now, but while this is not fact, you can make it somehow, and this is what I will suggest to you.

      If you use "input in digits" (I will rename the word "digits" to "price fraction" later), this will skip fxDreema's point format settings, because you can write exact value that does not depend on broker's digits. 0.00010 means 0.00010 everywhere. So if you have input constant like "OnePipIn_EURUSD" that is set to "0.00010" and another input constant like "SL" that is set to "20", within the EA you can do this calculation:

      SLasPriceFraction=SL*OnePipIn_EURUSD
      

      The result will be 0.00200 and will not depend on broker's digits. It will depend on "OnePipIn_EURUSD" that will be input parameter for the EA and the one who uses that EA will be able to control it.
      In other words, with "OnePipIn_EURUSD" parameter you control what "SL" means.

      posted in Questions & Answers
      fxDreema
      fxDreema
    • RE: Simpler Way Than Using 8 Blocks?

      About "Market (empty=Current)" parameter, when it looks empty, it is:

      When chart symbol is EURUSD, this parameter is EURUSD
      When chart symbol is GBPUSD, this parameter is GBPUSD
      and the same way with any symbol

      And no "Contition" is needed above "Less than..." block.

      posted in Questions & Answers
      fxDreema
      fxDreema
    • RE: Control of trades, new trades and add to volume - help!

      Not exactly limitation, but something that MT4 is not designed to do. But I have idea how to trick it by using Comment attribute of trades. I decided to link all trades created with "Add to volume" with their parent trade, and when some of them is closed or modified - to close or modify others in that group. And this will take some time because multiple blocks and functions are depending on this...

      posted in Questions & Answers
      fxDreema
      fxDreema
    • RE: Simpler Way Than Using 8 Blocks?

      If symbol parameter of every of these blocks should be the symbol specified in the Condition that is connected to it (now most of the blocks are that way, some of them are mixed), then you need only one "Less than..." block with specified market and set to empty (empty=current chart symbol).

      Also, blocks under "on Init" are executed once, right when EA is added to the chart. So there you can define constants (variables that will not change) and use them in "on Tick" without recalculate them on every tick.

      posted in Questions & Answers
      fxDreema
      fxDreema
    • RE: Control of trades, new trades and add to volume - help!

      Or you can control trades in other way. The best is if you use their parameters, so in case EA is restarted to be able to continue from where it was. If you use variables, this is not the case.

      So you can ask for lot size before going to add to volume. I noticed that you are using different lot sizes for the initial trade and the other.
      Or you can use another Buy now with different Group number that will be filtered out from the loop. One more trailing stop will be needed as well.

      posted in Questions & Answers
      fxDreema
      fxDreema
    • RE: Control of trades, new trades and add to volume - help!

      Well, the concept of adding to volume in MQL4 leads to some problems, because there is no function to add to volume, it's really creating an independent brand new trade that shares nothing with it's "mother". So even if you can program in MQL4 there are problems like this sometimes 🙂
      At least there is a function to partially close trades, and this makes it possible to check if trade X has "mother" even if you restart everything.

      I tested this on EURUSD and it looks fine, there are no trades opened in almost the same time, so I think that 2 pips for pips away are too small for this symbol and this results in adding to volume right after "Buy now" opens it's trade.

      posted in Questions & Answers
      fxDreema
      fxDreema
    • RE: Variable For Broker's Minimum S/L

      Let's say you want to tell Trailing stop to keep SL at the minimum distance. If you set small value it should do that by itself. Is there another reason for you to use this parameter?

      posted in Questions & Answers
      fxDreema
      fxDreema
    • RE: Variable For Broker's Minimum S/L

      I will check that ","->"." problem...
      But this formula gives value in points, but in fxDreema "pips" can be different, it depends if the broker is 4 or 5 digits, and Point format set in fxDreema. There is something more to be added to that formula, but I don't think you need to do that, because when Trailing stop modifies SL or TP, it checks stops level and if SL or TP is too small - it takes the minimum. You can try this if you set fixed pips to something small, for example 1.

      posted in Questions & Answers
      fxDreema
      fxDreema
    • RE: Variable For Broker's Minimum S/L

      In MQL4 this value can be get with:

      MarketInfo(Symbol(),MODE_STOPLEVEL)
      

      the returned value is in poits, for example it can be 20 in 5-digits broker (0.00020). I can add this somewhere, but you can also use this is Value -> Numeric.
      For specified symbol:

      MarketInfo("EURUSD",MODE_STOPLEVEL)
      

      But now when the requested SL is too short, the minimum is taken. Or at least it tries to take the minimum, but sometimes there are error messages because the price changed. Well, even if this happens it will try to send the trade with updated SL until it succeed.

      posted in Questions & Answers
      fxDreema
      fxDreema
    • RE: Control of trades, new trades and add to volume - help!

      Maybe the problem is that "Once per trade" detects all trades as independent. Let's say I can make it to recognize when a trade is "added" and not touch it... but it is still independent for trailing stop for example. Maybe I should add options to recognize when trades are added to volume ot removed from volume in both places.

      If this is the problem, there is workaroud - set some variable after Buy now (let's say with value 0) and after Once per trade - to 1. Before Once per trade ask if that variable is 0.

      posted in Questions & Answers
      fxDreema
      fxDreema
    • RE: Control of trades, new trades and add to volume - help!

      On my demo account it works, but for the period I tested it I think I can't find situation where 2nd trade is opened while 1st trade is still working. But I noticed something in "Start trades loop" block - Loop direction is Oldest-to-newest, and also you set to work with 1 trade in the loop. In other words - Start trades loop filters only the oldest trade that is present. So... if there are 2 ot more trades at a time, only the oldest one will enter the loop.

      I also found that 50% was not working because of some strange MQL behaviour - when we have something like 50/100, this results in 0, because it thinks that it has to treat the result (0.5) as integer. Weird, but I fixed that, so now better remove that "+50%", because it will add 0.5 to the right operand 🙂

      posted in Questions & Answers
      fxDreema
      fxDreema
    • RE: Control of trades, new trades and add to volume - help!

      I can see "Once per bar" in the project shared here on the first post. It's different in your account now.
      Anyway, for the project in your account...
      It's not a good idea to compare price levels with "==", you just can't expect that the price will be exactly "1.23456" (for example), it can skip this value so easily. Use ">=" or "<=" instead.
      Also, this "50%"... The keyword "%" is replaced by "/100" so in fact you have "+50/100" there, or "+0.5". Maybe I should edit the behaviour of "%" in case "+" or "-" is used, this is the first time I see it like this, but.... now better use *1.5 in such cases 🙂 But not in this case, I think. If your Open Price level is 1.3000, what can be 1.3000 + 50%? Do you really mean 1.9500 (1.3+half of it)?

      There are 2 main situation when somebody can easily check if something is not fine inside blocks.

      • The first situation is when one wants to see some value, then "Levels tesrer" block is really handy, it shows you the value in realtime. But also "Comment on chart" or "Alert message" are good.
      • And when it's not clear when some block passes or not - "Draw arrow" is the easiest way to check that. I also made special block for this "Logic points tester", and it works... but I found myself still using "Draw arrow" :)))
      posted in Questions & Answers
      fxDreema
      fxDreema
    • 1
    • 2
    • 323
    • 324
    • 325
    • 326
    • 327
    • 374
    • 375
    • 325 / 375