enjoysmath / Publications
Forum
[Solved] Please explain how to handle prev_calculated, somethings not making sense to me...
I understand that prev_calculated = 0 is passed to the first call of OnCalculate then it is incremented each time by one? So inside OnCalculate, how would I handle all bars that are less than prev_calculated? If prev_calculated starts at, 0, then there's nothing to do as in: for ( int i= 0 ; i <
Why can't I run debugger on this simple indicator that follows the updated MQL4 rules?
//+------------------------------------------------------------------+ //| MySmoothnessMetric.mq4 | //| Daniel Donnelly | //| enjoysmath@gmail.com |
[Solved] Why does OnCalculate get called every tick, yet prices are only per bar (1M minimal)
A tick seems to occur every second or several times a second in MetaTrader 4. And every tick OnCalculate() is called. However, OnCalculate's parameters such as high[i] are such that each index in high represents one minute of data minimally (by setting time frame to 1M). So what is the deal? How
This line crashes the debug session (porting old code to updated MQL4)
Hello, I'm in the process of porting some old code (start(), init(), etc) to the updated MQL4. I've gotten rid of all the compiler warnings and replaced start() with OnCalculate() and so on. Now without this one line, the chart window stays open (desired operation), but with the line, it crashes
[Solved] Unable to import functions from .ex4
Here's the importing hello world indicator: //+------------------------------------------------------------------+ //| MyLangTestingGround.mq4 | //| Daniel Donnelly | //|
[Solved] How to get datetime in string format?
How do I get at the datetime string? In the sense that the following code will then work: datetime now = TimeCurrent (); almostUniqueIndex = StringSubstr (now, StringLen (now) - 3 ) + WindowsTotal(); I'm in the processing of migrating legacy mql4 to updated mql4
[Solved] Unable to debug some indicators - is this because of legacy code?
Hi, With some indicators that I have code for, when hitting "Debug / Play" in the MetaEditor, the terminal will bring up the input parameter dialog, I hit Ok and then nothing shows up in the chart (where as drag-n-dropping in terminal shows something), and the window focus moves back to MetaEditor
Can't print text to screen using working text code and copy / paste.
//+------------------------------------------------------------------+ //| MySMI.mq4 | //| Daniel Donnelly | //| enjoysmath@gmail.com |
Can't place text - example code does NOT work
The example code for MQL4 can be found here: https://docs.mql4.com/constants/objectconstants/enum_object/obj_text What it does: Absolutely nothing!!!! Someone please help with displaying text at any time / price. This should be an easy thing to do