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
In OnInit (), you need to initialize the 'm_symbol' and 'm_trade' objects. See examples in CodeBase.
I looked in the CodeBase for m_symbol' and 'm_trade objects. It still opens many pending orders. Instead of one
Why do you need two identical objects?
And why don't you initialize the object of the CTrade trade class?
Why do you need two identical objects?
And why don't you initialize the object of the CTrade trade class?
I wasn't aware, I removed it. If I initialize the CTrade, that will give me errors:
I wasn't aware, I removed it. If I initialize the CTrade, that will give me errors:
Initialization block:
I looked in the CodeBase for m_symbol' and 'm_trade objects. It still opens many pending orders . Instead of one
What is it???
You cannot mix POSITIONS and PENDING ORDERS in one heap!
Initialization block:
Okay I have added the Initialization block
I'm still getting many Pending orders
What is it???
You cannot mix POSITIONS and PENDING ORDERS in one heap!
I'll change it to:
int Type=m_position.PositionType();
Okay I have added the Initialization block
I'm still getting many Pending orders
Forum on trading, automated trading systems and testing trading strategies
Counting pending orders with Ctrade problem
Vladimir Karputov, 2021.08.21 14:57
Initialization block:
Forum on trading, automated trading systems and testing trading strategies
Counting pending orders with Ctrade problem
Vladimir Karputov, 2021.08.18 15:31
Pending orders are counted using the COrderInfo trading class.
Example: Calculate Positions and Pending Orders
Forum on trading, automated trading systems and testing trading strategies
Counting pending orders with Ctrade problem
Vladimir Karputov, 2021.08.18 15:59
Or you can generally use this function:
if it returns 'true', it means there are pending orders in the market.
Forum on trading, automated trading systems and testing trading strategies
How to start with MQL5
Vladimir Karputov, 2021.08.21 05:35
The EA can open only one position of the same type
Code: Example One position of one type.mq5
How the Expert Advisor works: the 'CalculateAllPositions' function is called in 'OnTick'. The 'CalculateAllPositions' function calculates 'BUY' and 'SELL' positions.
Here is your code. Just rewrite your condition. I have a condition like this:
Here is your code. Just rewrite your condition. I have a condition like this: