Buy trade. order = mt5.order_send(symbol=symbol, type=mt5.ORDER_TYPE_BUY, volume=lot_size, price=mt5.symbol_info_tick(symbol).ask, deviation=slippage). print("BUY order placed at price", mt5.symbol_info_tick(symbol).ask)
We cannot read your mind, nor see your computer. If you need help with your code then show your code fully, and when you do, attach it as a file or use the "</>" Alt-S to post it properly. Don't just copy past as normal text.
Also, if you generated your code with ChatGPT, then don't even bother with it. It produces horrible useless code.
Sorry my friend, but we can only help you if you know what you have in front of you and have a minimum of programming knowledge after demonstrating your attempts.
We can't do the work for you after an AI has "spat" useless and unusable code at you.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Line 1 says: 'expressions are not allowed on a global scope = "Copyright © 2023, MetaQuotes Software Corp."
Line 2 says: ')' - unexpected end of program=
Buy trade
order = mt5.order_send(symbol=symbol, type=mt5.ORDER_TYPE_BUY, volume=lot_size, price=mt5.symbol_info_tick(symbol).ask, deviation=slippage)
print("BUY order placed at price", mt5.symbol_info_tick(symbol).ask)