suppress modify notification messages

 

Hi,

I'm working on an EA and I'm implementing a trailing stop loss, since neither MT4 nor my broker supports that feature out of the box, I have to implement it programmatically by modifying a SL closer all the time. That leads to a lot of Modify calls per order.

When I'm trying to use a tester to test my EU, 99% of all messages I get are modify messages which pollutes my log and my Results tab. I was wondering if there was a way (via configuration or programmatically) to supress those kinds of messages. they don't add any value (in my example) and just makes it increasingly harder to look for information that is actually useful for me.

Thank you

Rodion  

 
RodionPronin:

Hi,

I'm working on an EA and I'm implementing a trailing stop loss, since neither MT4 nor my broker supports that feature out of the box, I have to implement it programmatically by modifying a SL closer all the time. That leads to a lot of Modify calls per order.

When I'm trying to use a tester to test my EU, 99% of all messages I get are modify messages which pollutes my log and my Results tab. I was wondering if there was a way (via configuration or programmatically) to supress those kinds of messages. they don't add any value (in my example) and just makes it increasingly harder to look for information that is actually useful for me.

Thank you

Rodion  

Can you post a copy of the message you are talking about ?
 

You could modify your code so that the trailing stop moves in steps.

ie i pip instead of 1 point or maybe even 5 pips in larger time-frames.

That would reduce the number in the log.

Another way would be to write a stealth trailing stop.

ie instead of actually modifying the trade, save the trailing stop value (in an array, if more than 1 trade open at a time). 

Then check if price hits it and close the trade. 

 
GumRai:

You could modify your code so that the trailing stop moves in steps.

ie i pip instead of 1 point or maybe even 5 pips in larger time-frames.

That would reduce the number in the log.

Another way would be to write a stealth trailing stop.

ie instead of actually modifying the trade, save the trailing stop value (in an array, if more than 1 trade open at a time). 

Then check if price hits it and close the trade. 

Hi GumRai,

Yeah, I'm already doing that, in fact I step 10 pips everytime, but nevertheless, because I'm working with Day trends and oscillations, and my tp/sl spreads are relatively wide, I get a lot of modify even with a 10pip step. Also, at any given time, I might have more than 1 order (in fact I have somewhere around 10 - 20 orders) so multiply that number by numbers of modifies I get in my logs...

I could pump it up a larger pip step, but that will actually start crippling my algorithm, and I can't afford to do that just to improve logging. 

 
angevoyageur:
Can you post a copy of the message you are talking about ?

This is what I'm talking about...

sample

 
Just modify your stops and targets internally and exit if touched with a market order (of course not quite the same!)
 
gooly:
Just modify your stops and targets internally and exit if touched with a market order (of course not quite the same!)

No it's not, having to maintain the data structure for each of those orders in memory. And then if EA gets deinit/init - all those get wiped out (I know you're going to suggest to serialize to file and re read...)

Anyway, it seems that there is no easy answer... other than code my way around it... 

 

You can connect the magic number to the stops and targets.

So if the EA is restated it reads the magic number of the open trades and knows immediately how far away the stops and targets should be from the actual prices?

 
gooly:
Just modify your stops and targets internally and exit if touched with a market order (of course not quite the same!)
That's the same as my suggestion
GumRai:


Another way would be to write a stealth trailing stop.

ie instead of actually modifying the trade, save the trailing stop value (in an array, if more than 1 trade open at a time). 

Then check if price hits it and close the trade. 

RodionPronin:

No it's not, having to maintain the data structure for each of those orders in memory. And then if EA gets deinit/init - all those get wiped out (I know you're going to suggest to serialize to file and re read...)

Anyway, it seems that there is no easy answer... other than code my way around it... 

As you specifically stated that you are running the EA in strategy tester, deinit/init will not be an issue.

In real time, the history tab does not record every order modify

You could save the stops in a Global Variable of the client terminal, maybe using the ticket number as the GV name. 

Reason: