Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1209
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
How can I get a closed position comment in OnTradeTransaction?
Interesting question. To better understand it I manually opened a position and specified comment'123456' - then closed the position and ran theHistory Deals and Orders script. And now notice that the comment is present only at the order (trade order) on the basis of which there was a transaction that led to the position and at the transaction that occurred as a result of the execution of the order):
It means that when closing a position (in OnTradeTransaction the transaction type is TRADE_TRANSACTION_DEAL_ADD) we have to select all orders related to this position from the trading history and find the order that caused this position to appear.
Use the straight line equation:
Specify the bar number and price of the point on the left, specify the bar number and price of the point on the right (a virtual line is plotted on these points) and specify the bar you are looking for.
The function will return the price of the bar you are looking for.
Use the straight line equation:
Specify the bar number and price of the point on the left, specify the bar number and price of the point on the right (a virtual line is plotted on these points) and specify the bar you are looking for.
The function will return the price of the bar you are looking for.
Thanks, I'll give it a try.
How can I smooth out the line graph, at the level of the peaks (exactly the graph displayed on the main chart)?
iMA does not work, there is no smoothing, (maybe the Curve function?)
Trying to work with the built-in calendar. What is sus? Why is the data different, for example comparing with investing.com.
Here's a download of the embedded news (server time GMT+2) to the file:
And here is a screenshot from investing.com for the same date:
Importance difference. The important news on investing.com may be Moderate in MQL5 calendar.
I attribute the time difference of an hour (also requested from GMT+2 on investing.com) to the DST transition.
Hello.
Can someone tell me how to redraw the indicator from OnChartEvent() function? In this function I change the indicator buffer value, but it won't change on the chart. ChartRedraw() does not help.
The indicator changes on the chart only when running OnCalculate(). Is there any way to redraw it without starting OnCalculate()? Or how to force start OnCalculate()?
Hello.
Can someone tell me how to redraw the indicator from OnChartEvent() function? In this function I change the indicator buffer value, but it won't change on the chart. ChartRedraw() does not help.
The indicator changes on the chart only when running OnCalculate(). Is there any way to redraw it without starting OnCalculate()? Or how to force start OnCalculate()?
interesting question, i wanted to redraw the indicator in this event a long time ago, to see how they would look on a chart
I still have to use this event in the multi-currency, I guess the developers have postponed the normal multi-mode until MQL6
---
another question. As always, the developers have given a lot to think about
the same indicator can be built in two ways:
1 plot and 1 coloured buffer, or the same indicator with 2 plot buffers - one up with its own colour and another down also with its own colour, it's a variant without colour buffer.
Which one will be faster or more correct? I would like an expert answer
---
it would seem that you can look with 1 plot + 1 colour buffer 0 - up trend and 1 - down trend, and if you need value, you can take it from the plot. everything is separate and understandable, but
the second variant has 2 plot buffers - the first has EMPTY_VALUE and the second the value and the trend (colour)
---
MQL4 completely missed it, if the second option is just his legacy, are there any obvious advantages to using the 1-method? (i.e. throw out the second option at once)
asked two good experts a question, they could not answer.
Interesting question, I wanted to redraw the indicator in this event a long time ago, to see how they would look similar on the chart
I still have to use this event in the multi-currency mode, the developers seem to have postponed the multi-mode until MQL6
---
another question. As always, the developers have given a lot to think about
the same indicator can be built in two ways:
1 plot and 1 coloured buffer, or the same indicator with 2 plot buffers - one up with its own colour and another down also with its own colour, it's a variant without colour buffer.
Which one will be faster or more correct? I would like an expert answer
---
it would seem that you can use 1 plot + 1 colour buffer to look at 0 - up trend and 1 - down trend, and if you need value, you can use plot. everything is separate and understandable, but
the second variant has 2 plot buffers - the first has EMPTY_VALUE and the second the value and the trend (colour)
---
MQL4 completely missed it, if the second option is just his legacy, are there any obvious advantages to using the 1-method? (i.e. throw out the second option immediately)
Asked the question to two good experts, couldn't answer.
Didn't think I'd run into such a problem, as at first glance it should be self-evident to redraw the graph from the program. In this light, the purpose of the ChartRedraw() function is unclear...