Closed guzuomuse closed 4 years ago
Hi. Function BeginConnect is asynchronous. If you try to check connection immediately after begin connect you will have state disconnected. You need to subscribe on event ConnectionStateChanged to get changes of connection state.
i'm now learning how to use mtapi5. i will try as you suggested if we have a document for MtApi5Client Class would be much better :) thanks for your reply.
@vdemydiuk ,after some digging on this scenario, i dont know how to handel it.
let say i want to do get data from a indicator:
int handel_1=client.iMA("USDCAD", ENUM_TIMEFRAMES.PERIOD_H4, 21, 0, ENUM_MA_METHOD.MODE_SMA, ENUM_APPLIED_PRICE.PRICE_CLOSE);
but how we are sure the connection established already? could be that we must check the connection state is Mt5ConnectionState.Connected
first?
C# is not my first lanauge. so, could you be kind to teach me how to assure the connection is established before calling some functions like IMA etc. thank you very much
@vdemydiuk thanks for your great work. this libary seems very intresting.
is there doc for how to build connection? i have tried the code below,but always shows disconnected
explain it, i have attached the ea onto the terminal chart