I need a large number of bars (E.g. 1000) of indicator data in my EA. When the EA starts, obviously it will then need to copy 1000 bars from the indicator in an array. On subsequent ticks (or in my case, subsequent bars, since it is stopped from
I use the number of bars on the chart as a limit to a loop iteration. If the indicator is already loaded on the chart when the terminal starts, Bars() returns 0, and my code fails. If I remove and then replace the indicator on the chart, it returns
I am trying to create a class to hold variables related to various ongoing potential trade setups. A new Trade_Setup object is created each time a support/resistance level is approached/breached. To avoid adding multiple setups at the same level, I
I am trying to get my indicator, to, among other things, display the next likely support and resistance levels as a coloured band. The buffers placed above the DRAW_FILL declarations behave as expected, and the support levels display, but not the
I needed ti return a collection of results from a function , and so in the absence of tuples I chose to return a CArrayInt object pointer. As I am returning it though, I cannot delete it before doing so, and so end up with the xxx bytes of undeleted
Perhaps this is a peculiarity of my setup, but I cannot get the comment and uncomment hotkeys to work. If I select the command from Edit->Advanced->Comment it works, but not the combination of Ctrl+'. I am using a UK English keyboard on Windows
I am getting messages of "XXX bytes of leaked memory" "YYY objects of type DbleLess left" "ZZZ undeleted objects left" The function is called from the main OnStart() loop. I thought I was deleting the objects - so why the memory leak? void
I have two longish blocks of code that are identical except in various comparative statements '>' is switched with '<', '>=' with '<=' etc. I wanted to put these in a function and use one operator or another depending on a function input
is there a way to set MT5 so that only multiples of X (say, 5 pips) are displayed on the vertical price axis, as opposed to the seemingly random multiples displayed currently
No matter what I do I can't seem to get Bars to return the number of bars between two times. Please could someone tell me what is wrong with the code below. This is run as a script just to test. void OnStart () { datetime OpenTime[ 10 ];
Could someone please explain how to ensure the indicator calculates all bars available on the first run, and then only the bar that most recently appears. My indicator calculates what I want on the first run, but then does nothing. I can't figure out
From the documentation I thought it would be possible, but so far I haven't manage to make it work. I have included my code below, could someone please take a look and show me where I've gone wrong. As you can see from the commented out sections, I
I am trying to create an indicator that paints the area between two defined standard deviation bands. E.g. The area between the 2nd and 3rd deviations from the central MA. How can I do this? My code is below
Been trying this all day but now just getting myself more and more confused. Say that I want my EA to stop trading from 8:00pm until 6:00am the following day, how would I go about this? I have code for finding the relative GMT offsets for the broker
After closing part of an order at a take profit level which order in the order book is selected? I know the ticket of the trade changes, and therefore I assume it's position but not sure if the trade remains selected regardless of this
When passing values for slippage into OrderClose do adjustments need to be made for brokers with different digits? So for a four digit broker I would pass '3' for example, but for a five digits this would be '30'