Please help me with the coding of this strategy I am left with 02 errors. MQL5

 

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)


 
Bongumusa Ngubane: 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)

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.

 
Hello please find the attached. 
 
Bongumusa Ngubane #:
Hello please find the attached. 

It seems you have no idea about what your are doing right ?

 
Bongumusa Ngubane #: Hello please find the attached. 
Python, MQL5, MQL4? Seems like coding fruit salad to me.
 
I'm going to get some popcorn...
 
ChatGPT is the one that assisted me in coding. 
 
Chat GPT stated that it is MQL5 Python  
 
Bongumusa Ngubane #ChatGPT is the one that assisted me in coding. 

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.

 
Okay thank you very much for the information and assistance. You are kind people. I will enrol at University for a Coding short course. 
 
Bongumusa Ngubane #Okay thank you very much for the information and assistance. You are kind people. I will enrol at University for a Coding short course. 

You can always read the 6196 pages of the MQL5 Reference Manual. It would be a good start.

https://www.mql5.com/files/pdf/mql5.pdf

Reason: