Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1254
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
Hello all.
There is a candlestick indicator, tick indicator, it is not attached to any TF. A candlestick in the indicator may appear at any moment.
The question is, how to know from the EA about the appearance of this candle?
I tried to add an additional buffer to the indicator
into which I write 1 when a new candle appears.
The problem is that this buffer does not appear in the Data Scope window, and therefore its value cannot be read from the EA.
What to do?
Hello all.
There is a candlestick indicator, tick indicator, it is not attached to any TF. A candlestick in the indicator may appear at any moment.
The question is, how to know from the EA about the appearance of this candle?
I tried to add an additional buffer to the indicator
into which I write 1 when a new candle appears.
The problem is that this buffer does not appear in the Data Overview window, and therefore its value cannot be read from the EA.
How to do?
Add construction
Add construction
Thank you.
Hello. The Expert Advisor places pending orders on the levels. In the conditions there are ask and bid prices, respectively, for buy and sell orders. If I write :
in the tester, pending orders are placed both to buy and to sell. If I write:
only buy orders are placed. Sell orders are not placed and I do not have any log entries in this regard. I am quite satisfied with the first option, but I still wonder what the reason is.
Hello. The Expert Advisor places pending orders on the levels. In the conditions there are ask and bid prices, respectively, for buy and sell orders. If I write :
in the tester, pending orders are placed both to buy and to sell. If I write:
only buy orders are placed. Sell orders are not placed and I do not have any log entries in this regard. I am quite satisfied with the first variant, but I still wonder what is the reason.
check on 0.0 for starters
look at the rest of the code to call the price assignment
Hello. The EA places pending orders on the levels. In the conditions there are ask and bid prices, respectively, for buy and sell orders. If I write :
in the tester, pending orders are placed both to buy and to sell. If I write:
only buy orders are placed. Sell orders are not placed and I do not have any log entries in this regard. I am quite happy with the first variant, but I still wonder what the reason is.
Before referring to the prices through an object ofCSymbolInfo class, one must first refresh the prices
CSymbolInfo:RefreshRates
Refreshes quotes by symbol
Before accessing prices via aCSymbolInfo object, the prices must first be refreshed
CSymbolInfo:RefreshRates
Refreshes quotes by symbol
Thank you for your reply. As for me, it's much easier to use the first option than to write a bunch more conditions to something like this to make it work. InCSymbolInfo class, when defining ask and bid, the same formula is used as in the first variant. We get the result in the first case without price refreshing; in the second case, it is refreshed. We can get the ask price throughCSymbolInfo class without refreshing; bid, however, this variant is no good. I think it is too complicated.
Hi all!
Wrote an EA. Can't say it's profitable. When testing, sometimes trades appear in the results with a volume that doesn't match the algorithm's calculation. For example, two consecutive trades: one is calculated correctly, the other is calculated incorrectly. How to get rid of it?