Thanks ubzen.
But can the terminal output data from the logs for the EA to utilize?
Compiled commercial indicator. iCustom it OK. Paints 6 permanent indicators (+ in Data window). Sometimes indicates more than one trade on the same tick, and not only at the opening of a new bar.
EA misses duplicate trades. Likewise if I only trade at new bar. If I run on every tick, it places trades every tick infinitely.
When the alert indicator is on to trade manually, it has all the needed info at the right time. So seems like a possible solution IF I can tap into it and use it.
But I'm thinking that this must not be all that uncommon of a problem? Any other programming approaches &/or suggestions?
Any other programming approaches &/or suggestions?
Write you own Indicator and call it using iCustom. Job done.
Write you own Indicator and call it using iCustom. Job done.
Hi Raptor
This is a BIG black box that I think may use multiple indicators itself. I have no idea of the algorithm so this would not be a feasible approach for me. It's a good indicator with good results. It is already there including painting all of the required trading signals on the chart and the info is in the Data window, so ..... the chart arrows are made for this task, the Alerts are not, at least not directly. I'm rethinking that the alerts route is going at it the hard way through the back door. I would think that utilizing a permanent arrow on a chart only once must be a fairly common programming task? Might as well tackle it through the front door and only resort to even finding out the circuitous route of using the Alerts not intended for EA trade signalling that is a duplication of the arrows on the chart that are intended trading indicators ONLY if I have to.
Going to repost this under that topic. I know about duplicates, and this both is and isn't one as it's a completely different problem than I posited in the topic, so I think my grounds are valid. I'll very likely 'hear about it' anyway.
Hi Raptor
This is a BIG black box that I think may use multiple indicators itself. I have no idea of the algorithm so this would not be a feasible approach for me. It's a good indicator with good results. It is already there including painting all of the required trading signals on the chart and the info is in the Data window, so ..... the chart arrows are made for this task, the Alerts are not, at least not directly. I'm rethinking that the alerts route is going at it the hard way through the back door. I would think that utilizing a permanent arrow on a chart only once must be a fairly common programming task? Might as well tackle it through the front door and only resort to even finding out the circuitous route of using the Alerts not intended for EA trade signalling that is a duplication of the arrows on the chart that are intended trading indicators ONLY if I have to.
Going to repost this under that topic. I know about duplicates, and this both is and isn't one as it's a completely different problem than I posited in the topic, so I think my grounds are valid. I'll very likely 'hear about it' anyway.
The info painted to the chart is either an Object or from a position in an Indicator Buffer, get one by searching for the Object on the chart and reading it's values get the other from iCustom.
Try using the expert Logs and WINAPI.
It's there alright.
Including multiple trades of both same and different pairs with same time stamp, which I don't think my EA is catching.
As not intended for this purpose, seems like a cumbersome, laborious and additional (unnecessary) latency & resources load cluge though.
Must be a way to capture these much more directly only once from the chart? After all, that IS (one of) the reasons they are put there.
Please do not feed the troll.
When you respond, you give the troll power. When you ignore the troll, he starves for attention and eventually dies.
The info painted to the chart is either an Object or from a position in an Indicator Buffer, get one by searching for the Object on the chart and reading it's values get the other from iCustom.
Been using the iCustom route with limited success. It does work: as far as it goes. As the objects are painted predominantly, using a 'per tick' approach ends up generating infinite trades ad naseum. So I put in value and time stamp Boolean tests. This works to a degree, but as the indicator often calls for 2 identical trades on the same tick, as indicated by the 'Alert' box activated'' it misses these which are ~ 1/2 the orders. Not a winning formula. Even though I have no 'per bar' code in the EA, it only opens trades at the time of a new bar, which misses ones that the indicator often calls for at other times. Sometimes it just outright misses trades entirely. Not sure why. I think it is probably a latency problem and that the EA does just that: misses them entirely. Especially when it calls for more than one trade on multiple pairs on the same tick. I could post the code, but as this approach is so flawed, I think it is time to explore you other suggestion: the 'Objects' approach. No idea how, but obviously it is time to learn. One problem that I can see with this approach is the same as one that occurs using iCustom values: the same 'object' often generates more than one trade, as indicated in the alerts when I have them on. This system was intended to be a manually traded system.
Alas I find locating anything in MQ's OnLine Reference material such as the book, documentation and articles almost impossible to find anything in. Especially with no dedicated 'search' functions specifically for each of these. Generic researches return so many (irrelevant) results as to be almost useless as well.
Looking like your original suggestion of utilizing the Alert boxes which has ALL the needed info, including occasional pending prices, is looking more like the possible solution. If only it wasn't so obtuse, limited and indirect not being made for these tasks. Requires delving into WINAPI, DLLs etc that only adds more confusing and very limited capabilities,.
So objections aside, it's Objects for me! (< 8) Any advice on starting points &/or approaches will be appreciated (< 8)
Thanks again Raptor et al
Regards.
Meant this posting for this thread. But the other one is a completely different approach to the problem anyway and thus may attract different input, suggestions and solutions:
I'm getting very inconsistent trading activity with the EA using this Custom Indicator. The problem SEEMS(?) to stem from the fact that the indicator puts out multiple chart objects and alerts at the same time. With MT4 only having just the one active trading thread at a time, then with multiple simultaneous attempts obviously some are going to be blocked. I've increased IsTradeContextBusy() from 10 ms up to 25ms, with some, but very little results. Certainly not enough to be reliable. I am at least getting more 'TradeContextIsBusy' #146 Errors now
So looking for solutions to this. Again this can't be a new or unique MQL problem? What is the SOP for dealing with it?
The chart Indicator Objects that are indicative of trading actions don't disappear from the screen and these Object's values seem to be present in the Data Window for the entire Bar. So I should be able to access them other than when they just occur shouldn't I? I did put a time stamp on trading activities to try and help prevent duplicates.
But my problem is not being able to get my EA to place all of the trading activities generated by the Custom indicator consistently. The ONLY external variables are switches for 'Back Testing', showing the Alerts and that is about it.
So far I haven't been able to get the EA to close any trades at all even though the indicative chart objects and their Data values are there accompanied by the info in the Alert window.
The only thing that i have found in the logs is about what one expect 'Trade Context Busy'
Though of one approach was to immediately put ALL of the trading activity signals into a 'trading cue' and then process it in a loop. Arrays will only hold one type of info, so can't store all the factors of one trade action in one array (& location)
At one point when it was reacting every tick, then it repeatedly made the exact same trading action: opened up ~ 100 trades in a very short period of time )< 8)
PS: FYI: It just ticked over the hour on hourly charts and 7 alerts are showing, 3 of which are duplicates. That still leaves 4 trade actions to be carried out The EA made only one.
The info painted to the chart is either an Object or from a position in an Indicator Buffer, get one by searching for the Object on the chart and reading it's values get the other from iCustom.
Hi Raptor,
Yes the indicator does paint 6 trading action indication arrow Objects on the charts. I have an iCustom function for each of 6 of them in my EA which all seem to be fine and functional. I'm trying to utilize the values generated by these iCustom function as my trading signals. This value SHOULD be the same as what is shown in the Data Window of these 6 arrows, and is likewise the same in the Alert window. I have no evidence that the iCustom values are any different from these or wrong. The trades that my EA does make are the correct and corresponding values.
I haven't been able to get it to Close any orders at all yet, just place SOME of them.
I increased the IsTradeConextBusy() Sleep() time from 10ms to 25ms. This has only seemed to allow it to actually generate more 146 errors: Trade Context is busy
So in its current form it is way to erratic and unreliable to trade with. Their must be a/some well used methodologies for what must be a fairly common occurring problem in MQL4. Working with the Trade Context alone isn't adequate. It just plain misses some trading actions and lets them go by.
On 1 hour charts, the Object values in the Data Window ARE there for the entire bar. The Trading Arrow Objects remain on the charts permanently.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use