(on Trade) Event Data will not work correctly under "on Chart". Better imagine that you are under "on Tick". The data for (on Trade) Event Data in only set when some trade event happens - when some order is created, removed or modified, but not when you click on a button.
Posts made by fxDreema
-
RE: Button to bring Stop Loss to Break Even - Problem with Modify Stops of tradesposted in Questions & Answers
-
RE: Lot sizingposted in Questions & Answers
Oh, even I don't know what happens. See, Martingale is something that should be used when you have 1 trade at a time. But people wanted to be able to create 2 and more trades and still using Martingale. Then someone wanted to do Martingale over pending orders. For me this is... I don't know. Pending orders doesn't even exist, you don't know their outcome.
What I want to say is that even I don't know what were the rules of Martingale when pending orders are used. Maybe the EA looks at the last running trade first, or if there are no trades -> at the last closed trade. This is how it works in "Buy now"

-
RE: idiot questionposted in Questions & Answers
Well, I would not use "AND", I normally connect conditions one after another. Otherwise think of "Formula" as a simple calculation, which it is. Put it where you want to make that calculation... somewhere before the block where you want to use the variable

-
RE: Do not repeat Lotsposted in Questions & Answers
I'm not sure what you mean... Martingale is not a block, it's a calculation that is made before creating new trade, it exists in those Buy and Sell blocks. Martingale is for the lot size, not for how many trades to create.
-
RE: How can i to get the maximum price after the price crosses any moving average ?posted in Questions & Answers
This candle is unknown and to find it, you need to search for it. And this is what I'm showing in the example.
-
RE: Paint Arrow at broken Fib Levels?posted in Questions & Answers
Here I just wrote about fibo levels in another topic: https://fxdreema.com/forum/topic/6400/pending-order-in-fibo-level
-
RE: How to make Terminate function reference the current symbolposted in Questions & Answers
Something doesn't look good. See... in MQL and in every programming language, we define strings (text) with those symbols - either " or ', or even `. Depends on the language. In MQL4 we use ". So we can have:
int integerValue = 123; double doubleValue = 0.123; string stringValue = "This is text";You can add two numbers easily, like we do it in the calculator:
someIntegerValue = 123 + 456 + 789;And we can concatenate strings in a similar way:
someStringValue = "Hello" + ", " + "World" + "!";You can see that + are used, but we are working with strings here. And the result is Hello, World!
In fxDreema this "Message" field is a string field, but you don't need to write those ", they are automatically added later. This means that whatever you write, it will be a string. Write Symbol() and you will see text that says Symbol(), this will not be treated as a function.
By adding "" + and + "", you trick fxDreema a little bit, and you can write MQL4 code between those. If you can see at the output source code, you can probably better understand what is going on. But why double " and then +, and then + and again ""... it doesn't matter, just accept that it works that way. Use these when you want to put functions and other MQL4 stuff between them, but keep them at the beginning and at the end. This syntax of triple quotes - "" " - is not valid. Do this:
"" + Symbol() + " 18-Divergence detected or 17 2 losses detected or.." + ""Again, imagine that "" + and +"" are there only to do some trick, don't look at them as a syntax that is correct. They must be there, otherwise the trick would not work... I think. But what is between them should be correct MQL4 code.
-
RE: Pending order in fibo level...posted in Questions & Answers
Depends on the name of the object, do you know it or not? Here are 2 examples:
https://fxdreema.com/examples#Chart-ObjectsAnd in "Buy pending order" you can select custom price for "Open at price". Set "Price offset to 0". It could be something like this:

About the fibonacci level that can be between 0 and 32... when I manually draw fibonacci, I have 9 levels - 0.0, 23.6 and so on, until 423.6. This means that I can select these levels by specifying number between 0 and 8
-
RE: Is Server Time = MT4 Platform Time?posted in Questions & Answers
Ok, it is the time of the candles for sure. But honestly, I don't know what time brokers use around the world. Time is strange. Even here in Europe there are debates to remove the change of time that currently happens 2 times in a year. Some countries do that, others don't... Yes, in fxDreema when you see "Server time", this is what TimeCurrent() returns, it is the time that you can see on the candles. Candles are downloaded from the broker's server, s that's why I call it Server time. In the documentation they have this:
TimeCurrent
Returns the last known server time, time of the last quote receipt for one of the symbols selected in the "Market Watch" window. In the OnTick() handler, this function returns the time of the received handled tick. In other cases (for example, call in handlers OnInit(), OnDeinit(), OnTimer() and so on) this is the time of the last quote receipt for any symbol available in the "Market Watch" window, the time shown in the title of this window. The time value is formed on a trade server and does not depend on the time settings on your computer. There are 2 variants of the function.
-
RE: Is Server Time = MT4 Platform Time?posted in Questions & Answers
Server time is broker's time, it's like what their PC clock is showing. I don't think that all brokers around the world are using the same time

-
RE: How to make Terminate function reference the current symbolposted in Questions & Answers
This is a string input, and in the code all strings are put between " like this:
"this is my string"As you can see there are no " in the input fields, they are added later. But they will be added anyway, and everything you write there is considered a string, just a text.
"Symbol()"But you can trick it. Add "" + in the beginning and + "" at the end
"" + Symbol() + "" -
RE: Move objectposted in Questions & Answers
Each "Draw..." block can draw new objects or update existing objects depending on the first 2 parameters. It's a little bit complicated to explain it all here, so better check their description.
-
RE: Ignore Sunday/alter EA variable look backposted in Questions & Answers
What are the conditions? But in general, if let's say you are using MA, that MA is plotted over the latest candles and MA doesn't care about the days at all. I think that Sunday data appears in the first minutes of Monday, I don't really know why.
-
RE: I'm New......! Can someone check if I made it correct!?!posted in Questions & Answers
In your project I don't understand why you have "If trade" blocks instead of "No trade". "If trade" passes when at least 1 trade exists, but initially you have 0, so how can it ever pass?
Block 41 and block 2 - you can't have both crossovers at the same time. In block 41 better use > instead of x>. When MA5 is > MA231, this means that the last cross was x>, and you don't really care when that happened.
-
RE: Risk % of Free Margin - sometimes calculates incorrectlyposted in Questions & Answers
What is the name of the project? I can see it directly.
In MT you can get the server's time - the time of the candles. I guess that this time depends on where the broker is located. You also have local time, which comes from the clock of your PC. That GMT time is linked to your PC clock as well.
-
RE: datetimeposted in Questions & Answers
Try to put it in Value -> Numeric. Datetime is some kind of numeric integer type, so it should work
-
RE: concurrent trade when condition metposted in Questions & Answers
You know, I read your post multiple times, but I'm still not sure what is your question. I don't know if this can help, but because you are talking about groups... I want to tell you that if you want (and if it works for you) you can write multiple group numbers separated with comma, for example 1,2
