Problem with conditions
-
Hello,
I have a problem when I put a condition to open an order.
My rules are very simple : when a bear candle is followed by a bull candle : buy
when a bull candle is followed by a bear candle : sellSo far it works fine. If I add a condition (for example if price is over MA 100) after yhe candle block, no order are open. I tried to add condition to the buys, and only sells open.
I don't know if i can share my project somewhere to be more clear.
Thanks for your help
Thierry
-
Maybe the condition is somehow wrong? I can see your project, but there is no condition at the moment. By the way blocks 8 and 9 are not to be used there, these are actually for pending orders. But if you have some pending orders anyway, you should also put "For each Pending Order" to select the pending order(s) to be modified.
-
Thnaks for your answer. The project you see is not the last project I work on. Indeed I work also on local version. I can join the current versionHedge no Bias v2-3.xml so you can have a look.
ThanksThierry
......
Hedge no Bias v2-3.xml -
http://prntscr.com/3lr7tx
Those are unfortunately called "global variables", but they are different kind of global variables: https://fxdreema.com/documentation/proj ... metatrader
Use Value -> Numeric there (it will work with boolean) -
Hi,
I am not sure to understand your answer.
I modified the EA as I understood, but it didn't change anything.......
Hedge no Bias v2-4.xml -
I change the numeric value from 0 to 1 and it seems to work now
-
Thanks a lot for your help. This part works fine now.
The other step is to put a new condition : Buy order only if previous or current candle high is the high of the week (or day). Reverse for sell.
I really can't figure out how to determine that condition in dreema.Thanks
Thierry
I join the last version of my EA :
......
Hedge no Bias v2-4.xml -
Somewhere in Condition -> Market properties you can find Lowest/Highest options, or just use the High point of the weekly candle. Compare this value to the current candle high, and I guess it will work that way.
-
Hello,
I come back to you because I can't understand why the weekly condition doesn't work.
I compare the weekly candle high (or low) with the candle (shift 2) high, and if condition is met, it goes to next condition. If condition is not met, it goes to check Weekly's high with Candle (shift 1). If condition still not met =>message.
Everything seems very logical, but it always go to message, even if conditions are ok.
I spent the weekend over it, and didn't find the solution.thanks for you're help
Thierry

......
EA dreema.jpg -
Don't use "==" to compare price levels, ever. Use anything else, because the chance to have two prices exactly the same is small, especially when prices are like 1.23456. There is no guarantee that you will receive tick at price 1.23456. The tick can contain price 1.23455 or 1.23457 which is similar, but not exactly the same! Prices are not like 1, 2, 3, 4, 5.... they are like 1, 2, 4, 2, 6, 7, 9...
-
Yes I understand but in that case, if previous candle high is the high of the week, it is the same price precise to the pip on the 2 candles
-
I'm thinking about something. As I backtest, the weekly high or low is already settled and while testing the current W high/low is not the same that we'll have at the end of the week.
Maybe that while testing, the weekly reference is the candle already close (it's not supposed to but ...), even if prices didn't reach it yet during the test. Do you think it's possible ?thanks
Thierry
-
Interesting... it looks that weekly and monthly data can't be accessed when backtesting, it returns 0. It's ok on real testing, so I probably need to add some function to calculate weekly and monthly data based on daily when backtesting
Those russians are always missing something.
http://forum.mql4.com/57611I don't know when will I do that fix, but for now if you don't care about mondays I can suggest to look at the last 7 days:
https://fxdreema.com/shared/Imrkebc3 -
__Interesting... it looks that weekly and monthly data can't be accessed when backtesting, it returns 0. It's ok on real testing, so I probably need to add some function to calculate weekly and monthly data based on daily when backtesting
Those russians are always missing something.
http://forum.mql4.com/57611I don't know when will I do that fix, but for now if you don't care about mondays I can suggest to look at the last 7 days:
https://fxdreema.com/shared/Imrkebc3[/quote:3nm0rr29]Thanks for your answer. I will test it live to see if it works ok. But maybe I did something wrong so I enclose my EA so you can have a look if you have time.
I'm afraid that testing on 7 days will give wrong results as weekly calculation goes from Monday to Friday. But thanks you for the piece of code. It will be useful for visualising on the graph.
Thierry
......
Hedge no Bias v2-5.xml -
You can use this "Indicator tester" block to see any numeric thing as a line (or numbers below the candles). Maybe this can help: http://www.mql5.com/en/code/8198. I didn't tested it, but it looks simple so it should work
