AutoCycle through existing trades AND Program Documentation & Flow, ?

 

Howdy one and all,

I’m a newtbee at this and have to say that even just trying to find a way to effectively get started and how to proceed on the best course is most definitely not easily discerned.

I’m trying to figure out modifications of some existing programs as well as writing my own. As some of you know, I REALLY want to find some means of finding and documenting the program flow. I’ve been advised to utilize print statements to help and I am, but I'm trying to figure out how to get them to pause &/or halt where I want them to, or at least step through the program one line at a time. I'm going to try using alerts so that hopefully it halts the program when and where I want it to and gives me the info that I am trying to find out. Otherwise I guess I'll just have to put print statements EVERYWHERE and then figure out where it connects to in the program and what the context is and what it means . The last part may seem quite obvious, but if I have a couple of hundred print statements on one run through a program. )< 8( Hence wanting to add program line numbers as addressed in the next paragraph. What decade or century was this programming language designed in anyway? Perhaps it was meant to be utilized in Charles Babbage's creation? They would likely be on equal footing! No offense intended, though it is likely some will be taken.

Also I’m trying to figure out how to add line numbers to the programs. I would prefer that they were something other than all '//' 'comments'' so that I might even be able to use them as actual program elements. If anyone knows what I could use to add line numbers without them all causing warnings or errors when compiled would be great. Some way to automatically generate line numbers rather than having to manually add all of them to existing programs would most definitely be a big bonus as well.

I know that I’m trying to figure out how to do things with MQL4 that isn’t inherently built into it; but this is nothing new for me and these things would most definitely be an improvement and beneficial for everyone. I’m clutching at straws, but nothing ventured ……

Is there a way to automatically rotate through all open trades and then have logic elements to manipulate the ones that meet specified conditions and then move on to the next one?

If there is, is there a way to put this into an 'infinite loop' until a logic condition breaks it out of this continuous scanning of open and active trades?

I'm wondering about such loop conditions for other functions as well. The documentation for the 'return' operator/command says that it 'returns control back to the program that called it'. To me this means calling another completely different external program, script, library or included files etc as a 'sub routine'. But they are used within individual stand alone programs. So what do they do in this context and what/where is the 'point that it returns program control back to' and I how do I discern this?

Thanks for any and all help with any of these things.

Regards,

DougRH4x

PS: The sooner I find out how to do some of these things the sooner I'll stop complaining about them! LoL It may be a pain, but gotta keep a sense of humor about such things to help keep them in proper perspective. (< 8)

 

Doug,


I'll refer you back to your previous post where, after we all explained that there is no debug facility in MT4, I pointed out how I'd been able to do what you want by using the debug facility in another software platform.

It's the last post in the thread:

https://www.mql5.com/en/forum/122850/page2


CB

 

Hi CB,

Forgot about that one.

Thanks again, on my way to check it out ant try it