Need help, MQL4 first timer...
Hello everybody, thank you very much for any support you would kindly give me.
I am a newbi in programming and I am trying to make this few lines work... It is very simple stuff: when I press the "u" button, it opens a buy order, when I press the "n" button, a sell order is triggered.
Then, it checks which kind of order is opened (but or sell) and it applies a trailing stop according to the parameters ("spostamento/shifting" and "profitto/prifit" I put in an editable field together with the lots number "lotti").
This is the "Frankenstein code" I put together :), I run it and... nothign happens!! :D
Any help would be much appreciated... thanks so much.
***
Please insert the code correctly - using the button ![]()
Please use the code button (Alt+S) when pasting code.
Topics concerning MT4 and MQL4 have their own section.
In future please post in the correct section.
I have moved your topic to the MQL4 and Metatrader 4 section.
Please use the code button (Alt+S) when pasting code.
Topics concerning MT4 and MQL4 have their own section.
In future please post in the correct section.
I have moved your topic to the MQL4 and Metatrader 4 section.
Please insert the code correctly - using the button
Always use
Read the documentation for OrderSend and check the return value. Print the error if necessary.
There will never be a trade with the ticket #0
Thank you Keith,
yes I used #propery strict but didn't mention it.
You are right, I should selcet by position and not by trade...
Why do you think the keyboard event is not working?
Also print something when the key is pressed in order to check.
Hello everybody, thank you very much for any support you would kindly give me.
I am a newbi in programming and I am trying to make this few lines work... It is very simple stuff: when I press the "u" button, it opens a buy order, when I press the "n" button, a sell order is triggered.
Then, it checks which kind of order is opened (but or sell) and it applies a trailing stop according to the parameters ("spostamento/shifting" and "profitto/prifit" I put in an editable field together with the lots number "lotti").
This is the "Frankenstein code" I put together :), I run it and... nothign happens!! :D
Any help would be much appreciated... thanks so much.
***