Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 883
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
It is the same in mql5. It is even slightly extended. Isn't it what we need?
SYMBOL_TRADE_TICK_VALUE
SYMBOL_TRADE_TICK_VALUE_PROFITvalue
double
SYMBOL_TRADE_TICK_VALUE_PROFIT
Calculated tick value for profitable position
double
SYMBOL_TRADE_TICK_VALUE_LOSS
Calculated value of a tick for a losing position
double
SYMBOL_TRADE_TICK_SIZE
Minimum price change
double
The first thing that caught my eye was the sequence of buffers.
The build buffers must ALWAYS run in sequence. I.e. if the data buffers are number 2 and 3, then the colour buffer MUST be number 4
If this is not the only error, we will look further.
OK, did find such a feature in the instructions, here:
".....
boolSetIndexBuffer(
intindex,// index of the buffer
doublebuffer[],// array
ENUM_INDEXBUFFER_TYPEdata_type//what will be stored
);
Parameters
index
[in] Indicator buffer number. The numbering starts from 0. The number must be smaller than the value declared in #property indicator_buffers.
buffer[]
[in] Array declared in the custom indicator program.
data_type
[in] Type of data stored in the indicator array. Defaults to INDICATOR_DATA (values of the calculated indicator). Can also take INDICATOR_COLOR_INDEX value, then this buffer is intended for storing indices of colours for previous indicator buffer. Up to 64 colours can be specified in the line #property indicator_colorN. The value INDICATOR_CALCULATIONS means that this buffer participates in the intermediate calculations of the indicator, and it is not intended for drawing.
I tried to redo it and got even more bullshit. The histogram was gone altogether and the line indicator became strange to say the least. The signal one was cut off above 50 and the main one was lower. There are no such cutoffs in the code.
I gave you a link to study not the histogram, but how to work with the colour buffer. Abstract away from the histogram, and focus on how you need to work with colour.
I studied it, but nothing new, apparently it is (new to me) of course, obvious to all the initiated, self-explanatory. I could not find anything new, except the above-described feature of mutual arrangement of buffers during indexing. This sequence respected, got an even cheesier picture.
Pictures below, file attached
Hello.
Can you please tell me where I can find the algorithm for "reliable" order opening (so far I am only interested in market orders), because I am stumped.
The problem is that in my account (Alpari) the StopLevel and FreezeLevel levels are zero and if I use only thesehttps://book.mql4.com/ru/appendix/limits limitations it means that a StopLoss on buying can be set at Bid level and on selling at Ask level, but this is not true. In this case OrderSend returns a "No price" error (ERR_OFF_QUOTES, code 136).
At the same time, trades without stops or with stops of 50 or more points open without any problems.
I found out by experience that the minimum SlopLoss is 19 pips. I don't know how to determine this margin programmatically.
Hello.
Can you please tell me where I can find the algorithm for "reliable" order opening (so far I am only interested in market orders), because I am stumped.
The problem is that in my account (Alpari) the StopLevel and FreezeLevel levels are zero and if I use only thesehttps://book.mql4.com/ru/appendix/limits limitations it means that a StopLoss on buying can be set at Bid level and on selling at Ask level, but this is not true. In this case OrderSend returns a "No price" error (ERR_OFF_QUOTES, code 136).
At the same time, trades without stops or with stops of 50 or more points open without any problems.
I found out by experience that the minimum SlopLoss is 19 pips. I do not know how to determine this margin programmatically.
Try minStopLoss = Current price +/- (MaxValue(2*Spread, StopLoss));
Good afternoon the code below problem is often updated array adx_sig[9] . I wanted to get a dependency of data update on time. But something went wrong.