Tom Clayson
Tom Clayson
Tom Clayson
Added topic Basic question about how many bars to copy when using CopyBuffer in an EA.
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
Tom Clayson
Added topic Bars() returns 0 when called on first execution of indicator after the terminal starts, but not on subsequent executions.
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
Tom Clayson
Added topic static array in a class -> unresolved static variable
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
Tom Clayson
Added topic DRAW_FILLING type indicator buffers mixed up?
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
Tom Clayson
Added topic xxx bytes of undeleted memory when returning an object pointer
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
Tom Clayson
Added topic Comment Hotkeys
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
Tom Clayson
Added topic "XXX bytes of leaked memory" "YYY objects of type DbleLess left" "ZZZ undeleted objects left"
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
Tom Clayson
Added topic How can I use either < or > (or other comparative operator) in an expression depending on a function input?
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
Tom Clayson
Added topic Control the price labels on vertical axis
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
Tom Clayson
Added topic Bars() always returning zero.
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 ];
Tom Clayson
Added topic Indicator Calculation Loops.
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
Tom Clayson
Added topic Using PlotIndexSetInteger to change arrow code on the fly
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
Tom Clayson
Registered at MQL5.community
Tom Clayson
Added topic Histogram between two lines on Main Chart
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
Tom Clayson
Added topic Redirect Arrays
Is it possible to redirect array access if I wanted to set two arrays equal to each other, rather than have to copy one into the other
Tom Clayson
Added topic Turning EA on/off at specified times of day regularly.
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
Tom Clayson
Added topic Which order is selected after a partial close?
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
Tom Clayson
Added topic Slippage adjustment for 5digit brokers.
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'
Tom Clayson
Added topic Calling iCustom from an indicator? Multiple instances of indicator clash?
Are there any known issues with calling iCustom from an indicator? I am making a signal generator indicator that checks multiple other custom indicators my system uses. I have an order management EA running on the chart hence why I have gone this
Tom Clayson
Added topic Multiple Installations - Uninstall Problems
I currently have several MT4 installations, several from one broker and a couple of other brokers for testing purposes. I want to uninstall the unused terminals, but running uninstall, regardless of which directory it is run from, removes only the
12