vdemydiuk / mtapi

MetaTrader API (terminal bridge)
http://mtapi4.net/
MIT License
523 stars 282 forks source link

How to add Quotes #60

Open przemo098 opened 7 years ago

przemo098 commented 7 years ago

Hey

I can't see in api option for adding quotes how can I doo that ? I saw that I can handle adding quote but how to add them ?

Best Regards Przemysław Kamiński

vdemydiuk commented 7 years ago

Hi. Events QuoteAdded and QuoteRemoved will be raised when you add/remove expert MtApi.ex4 on chart in MT4 (same steps with MtApi5.ex5 for MT5). In another words on each opening MT chart with MtApi expert you will have event QouteAdded in MtApi client. And vise versa, you will recieved event QuoteRemoved when you close one of the chart with MtApi expert.

mhamri commented 7 years ago

let say if i have two mtAPI.ex4 on two different chart with same currency. one is showing h1, one is showing m5. if both of them are calling the quoteAdd and quoteUpdate how can I know which one triggered the event?

vdemydiuk commented 7 years ago

You can use event QuoteUpdate where you will receive MtQuote object with ExpertHandle value. This value is unique for each chart with MtApi.ex4.