- Question on MACD
- Elite indicators - metatrader 5 version :)
- Need Help please...
Forum on trading, automated trading systems and testing trading strategies
Fernando Carreiro, 2023.02.26 14:10
Please edit your post (don't create a new post) and replace your code properly (with "</>" or Alt-S), or attach the original file directly with the "+ Attach file" button below the text box.
NB! Very important! DO NOT create a new post. EDIT your original post.
You seem to be using ChatGPT.
We cannot help you if you used ChatGPT.
It produces horrible code, and since you don't know anything about programming in MQL yourself, you will not understand our advice, nor will you be able to fix it either since you don't know how to code.
So, either learn to code yourself or hire a human coder to do it for you.
If you are however, not using ChatGPT , then your code is incomplete and has many errors and cannot be compiled.
-
Please edit your (original) post and use the CODE button (or Alt+S)! (For large amounts of code, attach it.)
General rules and best pratices of the Forum. - General - MQL5 programming forum (2019)
Messages Editor -
ChatGPT (the worst), 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.
- Mixing MT4 and MT5 code together.
- Creating multiple OnCalculate/OnTick functions.
- OnCalculate returning a double.
- Filling buffers with zero in OnInit (they have no size yet). Setting buffer elements to zero but not setting Empty Value to correspond.
- Calling undefined functions.
- Sometimes, not using strict (MT4 code).
- Code that will not compile.
- Creating code outside of functions.
- Creating incomplete code.
- Initialization of Global variables with non-constants.
- Assigning a MT5 handle to a double or missing the buffer and bar indexes in a MT4 call.
- Useing MT4 Trade Functions without first selecting an order.
- Even it says do not use it
for coding. (2023) - Counting up while closing multiple orders.
- New bar code: Bars is unreliable (Max bars in chart), volume is unreliable (miss ticks.) Always use time.
- Not adjusting for 4/5 digit brokers, TP/SL and slippage.
- Not checking return codes.
- Not checking return codes.
- Loosing open tickets on terminal restart. No recovery (crash/power failure.)
- Not adjusting stops for the spread.
- Using OrdersTotal directly.
-
Do not post code that will not even compile.
MT4: Learn to code it.
MT5: Begin learning to code it.If you don't learn MQL4/5, 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 your code.
-
int RSI_handle = iRSI(_Symbol,PERIOD_CURRENT,RSIPeriod,RSIprice); CopyBuffer(RSI_handle,0,0,3,myRSIArray);
Perhaps you should read the manual, especially the examples.
How To Ask Questions The Smart Way. (2004)
How To Interpret Answers.
RTFM and STFW: How To Tell You've Seriously Screwed Up.They all (including iCustom) return a handle (an int). You get that in OnInit. In OnTick/OnCalculate (after the indicator has updated its buffers), you use the handle, shift and count to get the data.
Technical Indicators - Reference on algorithmic/automated trading language for MetaTrader 5
Timeseries and Indicators Access / CopyBuffer - Reference on algorithmic/automated trading language for MetaTrader 5
How to start with MQL5 - General - MQL5 programming forum - Page 3 #22 (2020)
How to start with MQL5 - MetaTrader 5 - General - MQL5 programming forum - Page 7 #61 (2020)
MQL5 for Newbies: Guide to Using Technical Indicators in Expert Advisors - MQL5 Articles (2010)
How to call indicators in MQL5 - MQL5 Articles (2010)
ChatGPT | |
EA builder | |
EATree | Uses objects on chart to save values — not persistent storage (files or GV+Flush.) No recovery (crash/power failure.) |
ForexEAdvisor | |
FX EA Builder |
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use