implicit conversion from 'number' to 'string' warning
- implicit conversion from 'number' to 'string' warning
- Array out of range
- Errors, bugs, questions
Please consider which section is most appropriate — https://www.mql5.com/en/forum/172166/page6#comment_49114893
The function PositionSelect() is used mainly for "netting" accounts and selects the open position based on the symbol's name (a "string" data-type) and not based on a position index (an "int" data-type).
It is a major logic flaw in your code and you will need to revise it. Consider using PositionGetSymbol() instead, but you will have to change your code accordingly.
PS! The purpose of forum is mainly to help users learn to code in MQL5 for themselves and answer their uncertainties, not to code things for them. If you need someone to fully review and correct your code for you, consider using the Freelance section.