@sirboyce But it would explain different results if you choose current spread for testing
Posts made by trader.philipps
-
RE: Trying (and failing) to create a simple EA...appealing to all FXDreema gurus!posted in Questions & Answers
-
RE: stopp loss on previous MA cross over candleposted in Questions & Answers
@abubakar Do you mean the price where the cross is visible on the chart? You'd probably get i trouble on flat markets.
-
RE: how to make to trade continuously using " various signal " if my signal will be like this .."Candle 1 is crosses MA 5"posted in Questions & Answers
@amirdemerbuq You'd rather use a condition block.

Each block when right clicking on it hast the "information" menau point that describes (sometimes better sometimes not) what the block is intended to do.
-
RE: once per barposted in Questions & Answers
@zooslinkis If it works on per tick base, but not on timer based conditions, it looks like an indicator issue maybe? .. If you may share that as well we might take a look.
-
RE: Trying (and failing) to create a simple EA...appealing to all FXDreema gurus!posted in Questions & Answers
@sirboyce Spread looks very high. Maybe that's the reason why some trades close late?!?
-
RE: Calculating Profit Before Entering Tradeposted in Questions & Answers
@Michael-0 But this information is just like a win quote of your broker. I don't think there is a way to calculate it.
-
RE: Variables issueposted in Questions & Answers
@seb-0 Tried to understand what you're doing, but I need some debug statements for this. However, you run the code every 100 minutes, is that what you want to do. I have no idea how fxdreema reacts when at this time candle in not closed, yet .. which price it takes. Maybe better to do once per bar and specify the number of bars that would equal your 100 minutes on the desired timeframe?!?
Further keep an eye on the block numbers as fxdreema run the start blocks or single blocks from lowest to highest number. In your case that means that your variable calculations happen after your buy condition check. If you don't restet the variable the results may be unpredictably.

See the screenshot. Here I reset Var1 each time the white dot is called.
So try to fix that first and then we can see if it calculates the desired results.
-
RE: i need helpposted in Questions & Answers
@l-andorrà At the moment the 2 conditions of crossing have to take place in the same tick (Candle ID:0) as @l-andorrà mentioned, you may change it to ID:1. But that wouldn't solve your issue.

See where I marked (1) and (2). At the moment the order close can just happen if at the same time both conditions (crossing of emas) take place at the same time!
You need to find a better condition that is not as strict as it is now. You may specify that only 5 x< 20 and 5 < 10 for instance. Or forget the cross and just look if ema 5 is smaler than ema10 and smaler than ema 20.
If it's smaler, the cross have happened anyway! -
RE: How to include library?posted in Questions & Answers
@miro1360 But you have to do it each time you save your mq4 file. That's a bit anoying, isn't it? Would be easy to have a block for includes maybe on init tab?!?
-
RE: Stops/adding variables?posted in Questions & Answers
@chemdog Okay, there are some things I'd like to mention not knowing if they are all related to the issues you are facing.
- You enable the MyFlag flag once and have a check on it (Block 301 and 302). You never disable it again. That's maybe the reason all close at once if the last candle was the bear candle! Especially as it has no timer or anything else for filtering (before block 302 as 302 not working like this).
Please specify how the trades should be closed again! - There is no check as far as I see, if the triggerLevel is below or above the current price. You only check if price is at triggerLevel. If price moves fast and is just 1 point above, it will not take the trade (Block 32)
- Check profit unrealized if I understand that block correctly sums all profits (and losses) and checks against the value specified in money. Not sure if it would also consider other currency pairs with trades from EA with same magic number. However, that may be your intention - don't know.
- Block 300 doesn't make sense here and you shouldn't re-use the loop variable. The order should be:
a) 297 .. calculate the bar, the current trade (handled by the "for each Trade" block) was opened.
b) do the loop stuff again such as in 25, 27, 28, BUT instead of loop variable you use vi_order_bar variable instead! for the maximum number of loops (5) you need to specifiy another variable that would be vi_order_bar + 5
Does that make sense or did I confuse you?
- You enable the MyFlag flag once and have a check on it (Block 301 and 302). You never disable it again. That's maybe the reason all close at once if the last candle was the bear candle! Especially as it has no timer or anything else for filtering (before block 302 as 302 not working like this).
-
RE: How to include library?posted in Questions & Answers
@gsmtricks I think the only way (so far I realized) is that you can incide external libraries when building a custom block. But I've never done this by myself and there are not so many examples here.
-
RE: i need helpposted in Questions & Answers
@sssorsss You specified the crossing again .. That will be a rare case that you hit both of them crossed.
Also check your candle ID settings. They should be equal unless you want them to be different!
-
RE: Price has moved to far.posted in Questions & Answers
@ejsellers It's quiet simple. I like to calculate distances in pips. As ATR is a price fragment, I need to transform it to pips and compare afterwards to candle size.
So first I need to get the pips. As there are different digits per symbol possible, I first calculate the multiplicator and store it in a variable (I later use). This I do on the on Init tab, because it's not necessary to do re-calculation more than at start unless your EA trades more than the symbol you attached the EA on.- Create a double variable that you store the multiplicator in (I used vd_toPipsMulti).
- On the On Init tab create a custom MQL code block with the following code
//calculate PIPs multiplicator
vd_toPipsMulti = MathPow(10,_Digits-1);// Print to log
Print("PIPs Multiplicator: " + vd_toPipsMulti);

- Now you have different options. I show 2, but you'd just need 1
3.1. Simple one, just the condition block

3.2 If you want to keep the values maybe for different calculations, you may store them to variables and than do the condition block

If you use ATR for more purposes than candle-size comparison you may prefer alternative 2 maybe.
-
RE: code not saving correctly after modifying blocksposted in Bug Reports
@l-andorrà That also happens on mq4 projects. I spend hours once to find my error in metaeditor as it wouldn't compile.
If I remember correctly in my case I left blank the fixed SL and changed to risk percent. That always didn't compile due to zero divide.Before I knew the reason I fixed it by recursively deleting blocks and create them again.
-
RE: Price has moved to far.posted in Questions & Answers
@ejsellers You can compare candle size of last candle with atr
-
RE: Read file dataposted in Questions & Answers
@ekifox Wow! Scientific work ahead! Please keep updating us!
-
RE: Parse WebRequest response and store into Variablesposted in Questions & Answers
@gsmtricks I meant the global options in the project.

-
RE: Parse WebRequest response and store into Variablesposted in Questions & Answers
@gsmtricks Did you copy the mqh file in the include folder of your mt4 instance?
Additionally set project properties to.point to your mt instance. -
RE: Parse WebRequest response and store into Variablesposted in Questions & Answers
@gsmtricks Interesting project you have. What you are looking for is a JSON deserializer. You may start here and follow the links.
There seem to be a custom library that has to be included in your project in order to use it. Unfortunately that is beyond my esperiences with fxdreema.

