![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
I know what does it do, it gives me the number of the error i'm incurred into:) infact i made a mistake because it was mentioned inside the print function and put it twice is a useless mistake:)
I've read a guide taken on a forum about ordersend and orderselect, but i repeat, don't know why i'm wrong writing the way i did.
I know what does it do, it gives me the number of the error
No, it returns the error . . . . from the Documentation
"The function returns the last occurred error, then the value of special last_error variable where the last error code is stored will be zeroized. So, the next call for GetLastError() will return 0. "
You call it . . .
this returns the value of the error . . . but you don't store this value to a variable . . . so now it's gone . . . then . . . you call it again, and now it is zero . . .
Ah ok thanks for clarifying...
Btw i solved the problem of tickes, though in a rough way. Now i have another problem:)
It modifies the stoploss (trailingstop) just one time after the trade opened, and i don't know how to reiterate the action. I mean, it's been told to me that everything in start() is recalled every tick, so the problem shouldn't exist.
Don't be bothered by so many prints please, they help me in finding which part of the code doesn't work properly.
I'm sorry i thought i already wrote conditions in the previous post... what's wrong with them?
IF there is at least one order, IF ea can select successfully the order, IF there are some conditions (for TLS), modify the order with stoploss that goes up.
I'm sorry i thought i already wrote conditions in the previous post... what's wrong with them?
IF there is at least one order, IF ea can select successfully the order, IF there are some conditions (for TLS), modify the order with stoploss that goes up.
You select the order based on the ticket number . . .
this is fine and works during the tick where you placed the order . . . . on the next tick the variable holding the ticket number is declared again and the previous value is lost. Making this variable static or globally declared might address your issue . . . . read your code through and see if it would work.
You select the order based on the ticket number . . .
this is fine and works during the tick where you placed the order . . . . on the next tick the variable holding the ticket number is declared again and the previous value is lost. Making this variable static or globally declared might address your issue . . . . read your code through and see if it would work.
Thanks Simon, didn't check that by my last post here
Selecting on ticket number can only be done if variable ticket number is declared at the beginning of the program before start( ) function
by using magicnumber and symbol you can select all the trades of the EA in a loop and if needed modify then
You select the order based on the ticket number . . .
this is fine and works during the tick where you placed the order . . . . on the next tick the variable holding the ticket number is declared again and the previous value is lost. Making this variable static or globally declared might address your issue . . . . read your code through and see if it would work.
GENIUS! i Solved it!... thanks
That problem was solved, but now sometimes it gives me an error
This is how i corrected it