![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'm a little confused . . . you should be processing the Objects based on the OrderHistory not the Object list . . . I said "Keep track of the last order that you changed the colour of the line for " not the Object.
How could I retrieve the OrderHistory? I don't find this in the Trading functions. I can only find OrderHistoryTotal().
I'm a little confused . . . you should be processing the Objects based on the OrderHistory not the Object list . . . I said "Keep track of the last order that you changed the colour of the line for " not the Object.
Oh, do you mean by iterating through OrderSelect(i, SELECT_BY_POS, MODE_HISTORY ) ??
Raptor, thanks very much. I've done it.
I'm a little confused . . . you should be processing the Objects based on the OrderHistory not the Object list . . . I said "Keep track of the last order that you changed the colour of the line for " not the Object.
Win lol
White is much better
I know this is a really old thread, but I am trying to do the same as the OP. I have almost no coding experience at all, but am starting to learn the basics for MT4. I have attempted to copy and complile the above into a script which generated the following errors. If someone could help me that would be really appreciated.
'BackTestingColours.mqproj' BackTestingColours.mqproj 1 1
'BackTestingColours.mq4' BackTestingColours.mq4 1 1
'drawTrendLines' - function declarations are allowed on global, namespace or class scope only BackTestingColours.mq4 16 5
'lastCompletedOrder' - undeclared identifier BackTestingColours.mq4 28 37
implicit conversion from 'number' to 'string' BackTestingColours.mq4 28 37
implicit conversion from 'number' to 'string' BackTestingColours.mq4 36 59
implicit conversion from 'number' to 'string' BackTestingColours.mq4 36 78
implicit conversion from 'number' to 'string' BackTestingColours.mq4 36 107
implicit conversion from 'number' to 'string' BackTestingColours.mq4 36 126
possible loss of data due to type conversion BackTestingColours.mq4 42 27
implicit conversion from 'number' to 'string' BackTestingColours.mq4 67 53
implicit conversion from 'number' to 'string' BackTestingColours.mq4 67 72
implicit conversion from 'string' to 'number' BackTestingColours.mq4 67 37
'}' - not all control paths return a value BackTestingColours.mq4 74 1
3 errors, 9 warnings 4 10