Questions from Beginners MQL5 MT5 MetaTrader 5 - page 201
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
Either attach the entire code or initialize your variables before the code snippet. You never know what you have there in variables, for example in
Whole code:
The whole code:
What the hell is that?
What the fuck is that?
)))))))
I am using MQL4 as the basis for my code:
I'm sure it is a result of my lack of knowledge and consequent lamer switch from 4 to 5. I will accept any suggestions how to improve my skills))))
The idea is to choose an order by ticket, select order type (Buy or Sell) and then use this type to check if the current order state is according to condition (current price minus open price) which should be greater than the price of one pip multiplied by the amount given (in my code this is take profit price divided by 10). If this condition is met you should make sure that the stop loss price is lower than the current price by the value of one pip multiplied by the specified value. If this is also true the price of the stop loss changes.
So the bullshit is the result of little knowledge and as a consequence of lamer transition from 4 to 5
The value is obtained using identifiers and functions OrderGetDouble , OrderGetInteger, etc.
Could you give me a small example, I just don't quite understand the construction, maybe it would be more correct: if(OrderGetInteger(ORDER_TYPE)==ORDER_TYPE_BUY)?
I can't tell you - I don't write in A. But I will ask a question: what prevents you from logging the result of this check?
Job)))))))))
Corrected the bugs, everything seems to be according to the handbook:
In debugging, it reaches the condition
and flies through the whole function without entering it. At the same time, the variable tik is declared globally: ulong tik=0; - and a new value is assigned to it when a response is received about order setting: tik=mresult.order; - this value changes in debugging. Why doesn't it go into the condition?
Can I have a small example, I just don't quite understand the construction, maybe this is more correct: if(OrderGetInteger(ORDER_TYPE)==ORDER_TYPE_BUY)?