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

 
Bongumusa Ngubane #: ChatGPT is the one that assisted me in coding. 

ChatGPT is nonsense. Stop using ChatGPT.
          Help needed to debug and fix an AI EA - Trading Systems - MQL5 programming forum (2023)

ChatGPT (the worst), “Bots Builder”, “EA builder”, “EA Builder Pro”, EATree, “Etasoft forex generator”, “Forex Strategy Builder”, ForexEAdvisor (aka. ForexEAdvisor STRATEGY BUILDER, and Online Forex Expert Advisor Generator), ForexRobotAcademy.com, forexsb, “FX EA Builder”, fxDreema, Forex Generator, FxPro, Molanis, Octa-FX Meta Editor, Strategy Builder FX, Strategy Quant, “Visual Trader Studio”, “MQL5 Wizard”, etc., are all the same. You will get something quick, but then you will spend a much longer time trying to get it right, than if you learned the language up front, and then just wrote it.

Since you haven't learned MQL4/5, therefor there is no common language for us to communicate. If we tell you what you need, you can't code it. If we give you the code, you don't know how to integrate it into yours.

We are willing to HELP you when you post your attempt (using Code button) and state the nature of your problem, but we are not going to debug your hundreds of lines of code. You are essentially going to be on your own.

ChatGPT
  1. Even it says do not use it for coding.*
  2. Mixing MT4 and MT5 code together.
  3. Creating multiple OnCalculate/OnTick functions.
  4. OnCalculate returning a double.
  5. Filling buffers with zero in OnInit (they have no size yet). Setting buffer elements to zero but not setting Empty Value to correspond.
  6. Calling undefined functions.
  7. Sometimes, not using strict (MT4 code).
  8. Code that will not compile.
  9. Creating code outside of functions.*
  10. Creating incomplete code.*
  11. Initialization of Global variables with non-constants.*
  12. Assigning a MT5 handle to a double or missing the buffer and bar indexes in a MT4 call.*
  13. Useing MT4 Trade Functions without first selecting an order.*
  14. Uses NULL in OrderSend.*
bot builder Creating two OnInit() functions.*
EA builder
  1. Counting up while closing multiple orders.
  2. Not useing time in new bar detection.
  3. Not adjusting for 4/5 digit brokers, TP/SL and slippage.*
  4. Not checking return codes.
EATree Uses objects on chart to save values — not persistent storage (files or GV+Flush.) No recovery (crash/power failure.)
ForexEAdvisor
  1. Non-updateing global variables.
  2. Compilation errors.
  3. Not checking return codes.*
  4. Not reporting errors.
FX EA Builder
  1. Not checking return codes.
  2. Loosing open tickets on terminal restart. No recovery (crash/power failure.)
  3. Not adjusting stops for the spread .*
  4. Using OrdersTotal directly.
Global Variables of the Terminal - MQL4 Reference
Global Variables of the Terminal - MQL4 Reference
  • docs.mql4.com
Global Variables of the Terminal - MQL4 Reference
 
Miguel Angel Vico Alba #:

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

Thank you 

 
Bongumusa Ngubane #:

Thank you 

What project are you working on? Maybe I could help 
 
Fernando Carreiro #:
Python, MQL5, MQL4? Seems like coding fruit salad to me.

Could you help to ad some few features to this EA. I have outlined everything in detail. Please reply immediately.


Use The EA add the following features. 1. Buy Only: A. When The Indicator Sends a Buy Alert/Signal A Buy order should be Triggered immediately. i. Input For 'X' number of positions, so that the trader can select His/Her desired Number of Positions. Maximum of 'X'. ii. Input for desired lot size. iii. Input for TP & SL in $ Dollar value not Pips. Each TP & SL should be for each Position separately. iv. TP for every Hour. That is, as soon as The Hourly TP is hit The EA should stop and Close all open positions, then start in the next hour. V. Above Conditions should be done for Each Signal. Create Input for Signal 1, 2, 3 and 4. Within the hour. That is Signal 1 is treated separately from 2, 3 and 4. Multiple signals is envisaged within the Hour, so that is why this has to be done. The EA should be able to work on Multiple Charts simultaneously, without interfering. 2. Sell Only: When The Indicator Sends a Sell Alert/Signal A Sell order should be Triggered immediately. The same Conditions applies to as Above for Buy only. *Tip* You can just put a Switch to select for either Buy or Sell, however there is an existing feature on the EA Ex5 file please. NOT ex4.

*All other feature on the EA Should remain.


 
gemini79 #: Could you help to ad some few features to this EA.

Help you with what? You haven't stated a problem, you stated a want. Show us your attempt (using the CODE button) and state the nature of your difficulty.
          No free help (2017)

Or pay someone. Top of every page is the link Freelance.
          Hiring to write script - General - MQL5 programming forum (2018)

We're not going to code it for you (although it could happen if you are lucky or the issue is interesting).
          No free help (2017)

 
William Roeder #:

Help you with what? You haven't stated a problem, you stated a want. Show us your attempt (using the CODE button) and state the nature of your difficulty.
          No free help (2017)

Or pay someone. Top of every page is the link Freelance.
          Hiring to write script - General - MQL5 programming forum (2018)

We're not going to code it for you (although it could happen if you are lucky or the issue is interesting).
          No free help (2017)

Check my previous post above I stated what I need and even attached 2 files. However check your inbox