Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 250
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
if (Volume[0] > 1) return;
Do not use this kind of check to detect the opening of a new bar, it will not work well in the account, only in the tester. You need to check either by bar time or by the number of bars on the chart
Ha ha... Here's a lie...
The problem turned out to be in the OpenOrders() function. I have completely forgotten to remove control of order opening on a breakdown of a candle (bar):
if (Volume[0] > 1) return;
So, on what TF the Expert Advisor was testing, it was opening orders on those minutes...
Stupid in general, on a hard one...
Thanks...
Better like this(https://www.mql5.com/ru/forum/138609/page482):
Better yet, pass the name of the desired TF into the function
Better like this(https://www.mql5.com/ru/forum/138609/page482):
You know, with / PrevTime / I tried something once, but it never worked. I guess I couldn't get that code into the right place.
With / if (Volume[0] > 1) return; / everything is much simpler. Here, as I believe, everything works for the selected TF. I do not know if it works on a demo but I have not noticed any errors, bugs and other details when opening orders.
But I have not used control of order opening on a new bar for a long time. I have managed to build the function of open positions control. Together with opening orders at a given time, we don't need bar control as such.
The code is just old. Apparently, I forgot about the limitations and bluntly inserted it and continued using it...
Can you please tell me how to get the price value of Fibonacci levels?
According to the condition, once the price has crossed the specified Fibonacci levels, a buy or sell trade is opened.
A Fibonacci object is drawn by an Expert Advisor using Kim's function: https://www.mql5.com/ru/forum/107476/page107#606564
It is drawn smoothly without any problems. But then how do we know the price value of the specified level?
This function doesn't seem to work:
Is it possible? Or, should we calculate prices for each level separately starting from OBJPROP_PRICE1 and OBJPROP_PRICE2?
This is nonsense. I was up half the night racking my brains... Of course, nighttime is probably not the best time to look for solutions.
Help please, good people!
Can you please tell me how to get the price value of Fibonacci levels?
According to the condition, once the price has crossed the specified Fibonacci levels, a buy or sell trade is opened.
A Fibonacci object is drawn by an Expert Advisor using Kim's function: https://www.mql5.com/ru/forum/107476/page107#606564
It is drawn smoothly without any problems. But then how do we know the price value of the specified level?
This function doesn't seem to fit:
Is it possible? Or, should we calculate prices for each level separately starting from OBJPROP_PRICE1 and OBJPROP_PRICE2?
This is nonsense. I was up half the night racking my brains... Of course, night is probably not the best time to look for solutions.
Help, good people!
There was already a similar question:
I want to get the price at a Fibo level of 23.6%
double flevel236 = ObjectGetDouble(0, "Fibo",OBJPROP_LEVELVALUE,1); This one gives 0.236, i.e. not price, but level.
Can you tell me how to get the price of the level. Thank you!
And it has been answered as well:
Just two arithmetic operations. Multiplication (0.236 multiplied by the difference between the prices of level zero and level one) and then addition (the result of multiplication is added to the price of level zero).
A similar question has already been asked:
I want to get the price at the Fibo level of 23.6%
double flevel236 = ObjectGetDouble(0, "Fibo",OBJPROP_LEVELVALUE,1); This one gives 0.236, i.e. not the price but the level.
Can you tell me how to get the price of the level. Thank you!
And the answer was given as well:
Just two arithmetic operations. Multiplication (0.236 multiplied by the difference between the prices of level zero and level one) and then addition (the result of multiplication is added to the price of level zero).
Thank you kindly!) That's what I thought in principle)
"0.236 multiplied by the difference between zero and first level prices" - only it would probably be more correct to say "between zero and last level prices".
Good afternoon people of the forum!
I am relatively new to trading on the exchange, only lost money, in general I decided to implement one idea, but to do this I need to know how to write code, mb it is already in the EAs, if anyone knows, guide me.
In general, the principle of martingale.
Opens on a sell or buy trade with sl and tp = 18
if it played in the + direction we instantly open one more position in the tp direction
if it played negatively, open a x2 position in sl direction after 15 seconds (if possible, this variable has to be set at the beginning)
All in all, if you will help it will be appreciated.