|
OrderSelect() Command in MQL4 Doesn't Work Properly |
Hunter166
|
Post subject: OrderSelect() Command in MQL4 Doesn't Work Properly |
Post rating: 0
|
Posted: Mon 13 Jan, 2014, 22:50
|
|
User rating: 0
Joined: Sun 15 Dec, 2013, 22:31 Posts: 5 Location: CanadaCanada
|
|
|
|
 |
API Support
|
Post subject: Re: OrderSelect() Command in MQL4 Doesn't Work Properly |
Post rating: 0
|
Posted: Tue 14 Jan, 2014, 16:26
|
|
User rating: ∞
Joined: Fri 31 Aug, 2007, 09:17 Posts: 6139
|
We are currently investigating this case.
|
|
|
|
 |
API Support
|
Post subject: Re: OrderSelect() Command in MQL4 Doesn't Work Properly |
Post rating: 0
|
Posted: Tue 21 Jan, 2014, 09:37
|
|
User rating: ∞
Joined: Fri 31 Aug, 2007, 09:17 Posts: 6139
|
We investigated this case:
1) OrderSelect() in your strategy actually works properly and shows exactly the same results in Metatrader 4 as in JForex platform. The problem is in incorrect MQL4 API usage. When OrderSelect() with SELECT_BY_POS flag is used, it expects order index as first parameter, but in your strategy order id is passed instead. See MQL4 documentation for details. 2) To make your strategy work in JForex as in Metatrader4, you need to change if statement in start() function of your strategy from "if(OrdersTotal() == 0 && CheckForOpen() == -1000 && CBarWaiting_Sign)" to "if(CheckForOpen() == -1000 && OrdersTotal() == 0 && CBarWaiting_Sign)". There is significant difference how if statements gets evaluated in MQL4 and Java, and unfortunately it can't be fixed soon. 3) We found some other small bugs, that could affect the work of your strategy. It's fixed now and will be available in new API release. The release on DEMO is scheduled this week.
|
|
|
|
 |
|
Pages: [
1
]
|
|
|
|
|