TheSnowGuru / PyTrader-python-mt4-mt5-trading-api-connector-drag-n-drop

Open Source Trading Strategies & End-to-End solution connecting Metatrader4 & Metatrader5 💹 with Python with a simple drag and drop EA. Fully tested bug free & efficient solution for live & paper trading⭐ Full Documentation ready. Lightweight, efficient and stable implementation 🔥
https://discord.gg/wRMUNP8ERa
653 stars 11 forks source link

Examples of live streaming data #20

Closed AmooShahab closed 11 months ago

AmooShahab commented 2 years ago

Hi there, Thank you for your effort to make such a perfect API. Can someone please give me some examples of getting live-streamed data with the following functions:

1 - Get_last_tick_info() 2 - Get_actual_bar_info()

These functions can be used for live streaming data as mentioned in the project document.

There are some good examples of using this API in the Python_script_example_PyTrader.py file, but no example of using it for live streaming.

best regards

Branly76 commented 2 years ago

The last tick info function retrieves the date, last ask and last bid value. The actual bar info retrieves Date, OHLCV for a defined period M1....D1. The close value for M1 bars, is the same as the close for for instance H4. Other values are different.You can see the close value as the actual value/last know value. It depends on what you need for your strategy. Tick data can change depending on volatility 20 times within a second, or once in every 2-4 seconds. If you can be more precise about what you need w.r.t. live data then i can make a small example. OK, now just in the middle of a move to a new appartment. But this is sunday all finished.

BR