Because the spread is too big. Buy opens at Ask, Sell opens at Bid. The bars are made of Bid prices only. Ask is always above Bid, but it's hidden. Make the spread 1.5 pips and everything will be more natural 
Posts made by fxDreema
-
RE: MT weird testing issueposted in Questions & Answers
-
RE: CONSTANTS...ARE TOO CONSTANTposted in Questions & Answers
When you edit the settings of the EA once (in MetaTrader), they are cached and then if you change the inputs (Constants) in the EA, there is no change. There is some file created somewhere with the same name as the EA that holds your last used values. Maybe this is the problem
-
RE: Optional Exit Trade option as an Input Parameterposted in Questions & Answers
-
You can see different ways for crossover here - https://fxdreema.com/examples/#Crossover If you use Condition, then you can combine it with Once per bar (probably 2 of them, one for buys and one for sells) to produce 1 crossover signal per candle.
-
It's not very original, but people put a Constant vs Value->Numeric in Condition
-
https://docs.mql4.com/basis/types But there are many data types and you will get confused. In general, string is the one that is most different, it is used for text (aka strings). All the others are numeric and similar. int is for whole numbers, double is for floating numbers, bool is for true/false (1/0).
-
-
RE: MARKING A PRICEposted in Questions & Answers
I forgot that in the settings for Take Profit there is also "% of Stop Loss". Try this

-
RE: How to include a mqh fileposted in Questions & Answers
This is currently not possible. The small problem is that I have the compiler (metaeditor.exe) in one folder and the folder where user files are located is different. Well, I can probably find a way to make such thing possible, but you are the first one (as long as I remember) asking for this thing, so in general people don't care about such feature

There is some workaround probably. When you make a custom block, you have this smaller field on the bottom where you can define global variables, imports and such things. I'm not sure that this will work, but try to put your includes there. Then when the block is used in a project, those includes should appear somewhere on the top of the file. You will get error if you try to compile it, because files are missing, but you can always export .mq4 file and compile it with MetaEditor locally
-
RE: Again on Trailing stop...posted in Questions & Answers
__
I work with a 5 digits broker, so I have to write 1.5 becouse else 15 will means 150 pips.
[/quote:v9ujalz7]No, you don't have
Click on the bench icon for the project's setting and look what is on the top. Maybe you will get, maybe not, but the idea is that the same EA works on 4-digit and 5-digit brokers with the same 4-digit numbers -
RE: Bug on Chrome and firefoxposted in Bug Reports
This is just a message. I have no idea what is the problem. I also don't have other reports about such problem. Maybe you have some browser extension that does something on the scrollbars?
-
RE: Accidentally deleted projectposted in Questions & Answers
I also keep backups for few days in the past, but obviously you don't need this anymore

-
RE: How to writte time in constantposted in Questions & Answers
datetime is actually an integer value, a whole number. It's a long story, but in your case use string as a data type
-
RE: Again on Trailing stop...posted in Questions & Answers
This is the block and the settings look fine... almost. Try with 15 instead of 1.5. Don't divide by 10, there is no need.
-
RE: Slide Orderposted in Questions & Answers
There is a block named "Trailing pending orders", I think this is what you want. Here is an example (for MT4) - https://fxdreema.com/examples/#Trailing....
-
RE: EA not taking all single candle patterns?posted in Questions & Answers
Ok, but when I make tests on my MetaTrader, everything looks 1:2. I have profit of $192 from one trade that is 1.2 lots, but even for this one SL:TP is 1:2. I don't know... what looks different in your pictures is that it is EURUSDpro, while I'm trying with EURUSD. What is the situation for other symbols? Or... what broker is this?
-
RE: Bug on Chrome and firefoxposted in Bug Reports
I don't have problems with scrollbars in FF and Chrome, but I'm sure that there are some problems with IE. This is exactly the opposite situation

If you know how, tell me if there are JavaScript problems. In Chrome - Ctrl+Shift+I, then look under "Console". Can you find something like error message there?
-
RE: Stop ATRposted in Questions & Answers
There is no function ATR in MQL4. There is iATR(), but it has some more inputs - https://docs.mql4.com/indicators/iatr
I never tested that, but I think this is the answer - https://docs.mql4.com/customind/hidetestindicators
-
RE: BUG (On Trade Event)posted in Bug Reports
I don't know what I was looking... I will fix that error
-
RE: EA not taking all single candle patterns?posted in Questions & Answers
If you measure SL and TP on the chart, is TP two times bigger? If this is true, then the lot size is calculated incorrectly. But the lot size also depends on the minimum lot step!
With smaller SL comes bigger lot and with bigger lot you have bigger amount of money per 1 pip. Each lot size is first calculated as exact value, something like 0.38765, but then depending on the lot step this value is rounded to the nearest possible.
Also when you make profits or losses, the Balance is changing and because of that 1% of it is also changing.
-
RE: BUG (On Trade Event)posted in Bug Reports
OnTrade() runs multiple times and this is normal for MT5. Even if something simple as closing a position happens, you know, this results in some deals and orders, many things. For each ot these "Pass" will run. That's why the events must be filtered.
I guess that something is going on because of the strange symbol. I don't even know what this WDO$ is. I am working with EURUSD most of the time. If you can give me demo account or something like that, so I can check it out...
-
RE: Turing Off EA after set $/Pips madeposted in Questions & Answers
Check profit (period of time)
Check it out. Tell me if you like it's name and the names of the neighbour blocks. I decided to rename them, but I'm not very sure... And this block now is pretty slow. But this is the thing, more options = less speed
