suppress modify notification messages

Back to topics list To post a new topic, please log in or register
avatar
9
RodionPronin 2015.01.21 18:50
 

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  

avatar
Moderator
3206
angevoyageur 2015.01.22 18:55 #
 
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 ?
avatar
Moderator
3406
GumRai 2015.01.22 21:54 #
 

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. 

avatar
9
RodionPronin 2015.01.23 19:56 #
 
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. 

avatar
9
RodionPronin 2015.01.23 19:58 #
 
angevoyageur:
Can you post a copy of the message you are talking about ?

This is what I'm talking about...

sample

avatar
2017
gooly 2015.01.23 20:28 #
 
Just modify your stops and targets internally and exit if touched with a market order (of course not quite the same!)
avatar
9
RodionPronin 2015.01.23 20:43 #
 
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... 

avatar
2017
gooly 2015.01.23 22:14 #
 

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?


avatar
Moderator
3406
GumRai 2015.01.24 02:25 #
 
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. 

 

Back to topics list  

To add comments, please log in or register