I guess plotting chart objects is outside the scope of the python api sadly
Python Trader code and skills sharing 59 replies
embedding python 19 replies
Monty python and the holy grail 4 replies
Upcoming MetaTrader5 with MQL5 3 replies
Python or Perl? 17 replies
time_setup_msc
DislikedHello guys, Can anyone here explain the general procedure for building mt5 python scripts (ea's that are attached to the chart) by this I mean, provide answers to questions like: 1. How to make it possible for the script to be attached to a chart (apparently not all scripts can be attached) 2. How to make scripts that work on multiple pairs at the same time? 3. How to make a script automatically work with chart (symbol) its attached to? 4. Does the script automatically work on each tick?Ignored
DislikedDoes anyone use the order expiration parameter? It doesn't seem to work with datetime format, and based on this https://www.mql5.com/en/docs/integra...t5ordersget_py I'm guessing it might need to be in that time_setup_msc format, whatever that is.. it doesn't look like a timestamp. I'd appreciate any help so I don't need to track expirations separately.Ignored
def _set_expiration(timeframe:str, info:dict, num_candles:int): ''' Set the order expiration at n candles from now. 'info' is from mt5.symbol_info(symbol)._asdict() ''' tf_to_sec = { 'H12': 43200, 'H8': 28800, 'H6': 21600, 'H4': 14400, 'H2': 7200, 'H1': 3600, 'M30': 1800, 'M20': 600, 'M15': 900, 'M10': 600, 'M5': 300, 'M3': 180, 'M1': 60, } # info.time is current server time return info['time'] + (tf_to_sec[timeframe] * num_candles)
DislikedHi guys, I just came across python integration. is it limited to just scripts or can we make EA's out of it ?Ignored
DislikedHello guys, Can anyone here explain the general procedure for building mt5 python scripts (ea's that are attached to the chart) by this I mean, provide answers to questions like: 1. How to make it possible for the script to be attached to a chart (apparently not all scripts can be attached) 2. How to make scripts that work on multiple pairs at the same time? 3. How to make a script automatically work with chart (symbol) its attached to? 4. Does the script automatically work on each tick?Ignored
Disliked{quote} Here are the available commands. https://www.mql5.com/en/docs/integra...on_metatrader5Ignored
Disliked{quote} Hi thanks for replying. I see that order_send function can be used to send orders to the terminal. Do I have to write and run the code in mql5 editor under python script folder ? As shown here? {image}Ignored
DislikedDoes anyone else have to make different time adjustments depending on whether you request ticks or candles? I have to add 8 hours for one and subtract 6 hours for another. Very odd.Ignored
DislikedIm trying to add some trade modification functions (partial close) and can't figure out the right params.. any one have code for that written?Ignored