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
You read [0 … Candles-1] values into rates.
Variable i goes up to Candles -1.
Therefor, variable l goes to Candles-1+Candles-1.
Therefor, l+2 reaches [Candles … Candles-1+Candles-1+2]. Array exceeded. Crash.
Creating a ticker tape panel: Basic version
This idea is quite interesting to implement and develop and it can also be a very useful resource for many, which is why I decided to show how to create the code for such a panel.
Creating a ticker tape panel: Improved version
But this data is not always enough and does not always reflect what people really want to see on the panel. It would be great to have some more details. This is what we are going to implement here.
PositionGetInteger(POSITION_TYPE) problem
Hi, I'm trying to use if(PositionGetInteger(POSITION_TYPE) == POSITION_TYPE_SELL) to work on the sell order but i found out that it doesn't work because it always return POSITION_TYPE_BUY no matter the order is sell or buy........ really don't understand what's happened or is there any bug anyone encountered?
Here are my sample code and the print out log showing both sell and buy order return POSITION_TYPE_BUY. Thanks a lot if anyone could help. Thanks.
PositionGetInteger(POSITION_TYPE) problem
Hi, I'm trying to use if(PositionGetInteger(POSITION_TYPE) == POSITION_TYPE_SELL) to work on the sell order but i found out that it doesn't work because it always return POSITION_TYPE_BUY no matter the order is sell or buy........ really don't understand what's happened or is there any bug anyone encountered?
Here are my sample code and the print out log showing both sell and buy order return POSITION_TYPE_BUY. Thanks a lot if anyone could help. Thanks.
It doesn't return POSITION_TYPE_BUY each time, it returns 0.
What are trying to do will never work, because you sent a trade request on the server, that doesn't mean you already have a position. It needs some time to be executed and the Terminal notified about it.
Calculate Positions and Pending Orders
Code: Calculate Positions and Pending Orders.mq5
Open positions: GBPUSD BUY 0.03 lot and USDPLN SELL 0.01
Pending orders are placed: USDPLN Sell limit 0.01 and GBPUSD Buy limit 0.03
open and take
Everything you need to learn about the MQL5 program structure
Every software in any programming language has a structure, after understanding this structure we can create or develop our software smoothly. MQL5 language's programs are the same as any other programming language has their structure and it is supposed to be understood by the developer to achieve the objectives of his project smoothly and effectively. In this article, we will provide information in this context to try to deliver its content easily as possible.
An example of get values from the iStochastic indicator
Code: iStochastic get value.mq5
Do not forget the rules: create the indicator handle ONCE in OnInit, use CopyBuffer to get the data.
Result:
Thank you.