Hi CB,
Thanks for your reply,
well, i am building a C# .NET application which connect to the MT4 local server,
i used the MetaTrader class but all its functions are related to the current Candlestick being updated simultaniously.
in the library of MEtaTraderAPI, i havent found any other classes that might query the last or few last finalized candlessticks.
in addition i tried to open the *.hst files in C# but unfortunatly i was unable to do that as well, though i am not sure if this is a good idea because i am not sure if these files are updated on the fly and if they wil contain the last finalized candlesticks for current time.
can you help with that ?
Thanks much,
Wasim.
Hi CB,
Thanks for your reply,
well, i am building a C# .NET application which connect to the MT4 local server,
i used the MetaTrader class but all its functions are related to the current Candlestick being updated simultaniously.
in the library of MEtaTraderAPI, i havent found any other classes that might query the last or few last finalized candlessticks.
in addition i tried to open the *.hst files in C# but unfortunatly i was unable to do that as well, though i am not sure if this is a good idea because i am not sure if these files are updated on the fly and if they wil contain the last finalized candlesticks for current time.
can you help with that ?
Thanks much,
Wasim.
Candlesticks are indexed.
0=current
1=previous
2=the one before that
etc
CB
High[0] returns the high of the current candlestick.
Open[1] returns the open of the previous candlestick.
etc.
I don't see your problem? Its all well enough explained in the docs.
CB
High[0] returns the high of the current candlestick.
Open[1] returns the open of the previous candlestick.
etc.
I don't see your problem? Its all well enough explained in the docs.
CB
Hi CB,
i am new in this, i tried TZMT4API and i had problem with the connection.
i am trying to use the METATRADERAPI, i looked inside the code for functions and classes and have no documents.
where can i find some documents?
appriciate your help.
Wasim.
Hi CB,
i am new in this, i tried TZMT4API and i had problem with the connection.
i am trying to use the METATRADERAPI, i looked inside the code for functions and classes and have no documents.
where can i find some documents?
appriciate your help.
Wasim.
Look at the first response I sent you at the top of this thread.
(!)
CB
Hi Guys,
I am using the MetaTrader APi, i have been looking for an object or a function to get the last finalized candle stick ( the last one before the live one ).
any suggestions ?
Thanks in Advance.
What are you trying to do? I'm guessing you have chosen the wrong programming start point. It sounds like you are trying to use the API to program, and not MQL4 which is the trading programming language. Did you go to this page and download the API?
https://www.metaquotes.net/en/metatrader4/
If so, then I don't believe this will be helpful for you with what you want to do, unless you actually are running a server locally.
Instead of that, look into one of these methods:
- Look at this thread on this site and see one of the third party trading APIs for metatrader. 'New API MetaTrader 4 AVAILABLE'. I don't believe they are selling it now, but last time I looked it worked for like ten minutes at a time.
- Write a C++ wrapper to allow your C# code to interact with MetaTrader. 'Help with crashlog analysis...'
- If everything else you are doing is already working, then use the DDE features of MetaTrader to access the candle data. http://www.4xlab.net/cs/forums/136/ShowPost.aspx
- Use MQL4 and program directly within metatrader (but I'm guessing you want to use C#, not mql4)
In each case, you'll be using something similar to what has already been suggested above.
What are you trying to do? I'm guessing you have chosen the wrong programming start point. It sounds like you are trying to use the API to program, and not MQL4 which is the trading programming language. Did you go to this page and download the API?
https://www.metaquotes.net/en/metatrader4/
If so, then I don't believe this will be helpful for you with what you want to do, unless you actually are running a server locally.
Instead of that, look into one of these methods:
- Look at this thread on this site and see one of the third party trading APIs for metatrader. 'New API MetaTrader 4 AVAILABLE'. I don't believe they are selling it now, but last time I looked it worked for like ten minutes at a time.
- Write a C++ wrapper to allow your C# code to interact with MetaTrader. 'Help with crashlog analysis...'
- If everything else you are doing is already working, then use the DDE features of MetaTrader to access the candle data. http://www.4xlab.net/cs/forums/136/ShowPost.aspx
- Use MQL4 and program directly within metatrader (but I'm guessing you want to use C#, not mql4)
In each case, you'll be using something similar to what has already been suggested above.
Thanks Jaman,
you helped much. i am able to run the client. using NDde.dll.
but i still dont know how to get the candles.
can you please put some code how to retrive ? i dont have any classes under NDde.dll that deals with CandleSticks.
Thanks Jaman,
you helped much. i am able to run the client. using NDde.dll.
but i still dont know how to get the candles.
can you please put some code how to retrive ? i dont have any classes under NDde.dll that deals with CandleSticks.
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi Guys,
I am using the MetaTrader APi, i have been looking for an object or a function to get the last finalized candle stick ( the last one before the live one ).
any suggestions ?
Thanks in Advance.