Differentiating manually entered "trade Management" EAs

 

Howdy all. A question for someone that is waaaaay smarter than me.

Is it possible to assign a magic number (or similar) to an EA that is managing a MANUALLY entered position, via profit targets and a trailing stop loss?

The problem I face is that I have two different strategies requiring a different EA to manage each. One strategy is for longer-term entries on a daily chart, and the other signals entries on 15 minute and hourly charts. I have two charts set up for each of the pairs I'm looking to trade (a total of 40 charts); each chart with their own relevant EA which is embedded into the profiles. At the moment, if I enter on the daily, and then open up the 15 minute, the EA on newly opened chart takes over the trade. Not a good outcome!

Ideally, if I was able to assign a unique identifier to each MANUALLY entered trade, then problem solved, as long as the EA on the shorter timeframe does not recognise the earlier trade. Am I making sense? Seriously, my head is spinning and I'd really appreciate some help. So far, my only option as I see it is to disable the expert in each of the charts and only enable when I'm about to enter, but that assumes that I'll remember to turn it back off again when I'm out of the trade. Very prone to human error.

Thanks guys,

oz

 

Hi, not possible trough the Orderwindow, you have to open a trade with a script.

//z

 
zzuegg:

Hi, not possible trough the Orderwindow, you have to open a trade with a script.

//z


Thanks for the fast (though depressing) answer //z.

Forgive my ignorance, but I come from an NT and TS background, and I'm trying to think outside of the box here. Is it possible to have a script initiate the trade by a method other than via data-generated signals? For example, a button on the chart that would set the script in motion. I know it sounds like I'm on happy beans, but I really can't believe that someone hasn't thought a way around this. Is it just me that wants to enter with some discretion, and let the EA manage mechanical exits?

Cheers,

oz

 
ozfader:

Howdy all. A question for someone that is waaaaay smarter than me.

Is it possible to assign a magic number (or similar) to an EA that is managing a MANUALLY entered position, via profit targets and a trailing stop loss?

The problem I face is that I have two different strategies requiring a different EA to manage each. One strategy is for longer-term entries on a daily chart, and the other signals entries on 15 minute and hourly charts. I have two charts set up for each of the pairs I'm looking to trade (a total of 40 charts); each chart with their own relevant EA which is embedded into the profiles. At the moment, if I enter on the daily, and then open up the 15 minute, the EA on newly opened chart takes over the trade. Not a good outcome!

Ideally, if I was able to assign a unique identifier to each MANUALLY entered trade, then problem solved, as long as the EA on the shorter timeframe does not recognise the earlier trade. Am I making sense? Seriously, my head is spinning and I'd really appreciate some help. So far, my only option as I see it is to disable the expert in each of the charts and only enable when I'm about to enter, but that assumes that I'll remember to turn it back off again when I'm out of the trade. Very prone to human error.

Thanks guys,

oz

Two ways I can see around this.

1. Have your order management EA's use the order comment rather than a magic number. When opening an order manually, you would have to remember to add a particular comment that your EA's are going to recognize later. If you're using something like mptm to manage your trades, I know that has an option to manage by comment rather than magic number.

2. Write/find/use a script to enter your manual trades and the script could then add a magic number or comment as required. I'd prefer this option since you don't have to remember to type in a comment every time.

It's fairly easy to modify the default scripts (or your EA's or if you have the source code).

A second

Regards, Paul.

 
ozfader:


Thanks for the fast (though depressing) answer //z.

Forgive my ignorance, but I come from an NT and TS background, and I'm trying to think outside of the box here. Is it possible to have a script initiate the trade by a method other than via data-generated signals? For example, a button on the chart that would set the script in motion. I know it sounds like I'm on happy beans, but I really can't believe that someone hasn't thought a way around this. Is it just me that wants to enter with some discretion, and let the EA manage mechanical exits?

Cheers,

oz

Hi a script usually doesnt wait for a signal. It gets executed as soon as you drop it on the chart. An advantage of opening orders trough scripts is that you are forced to stick on your moneymanagemnt plan.

Scripts are normally one time execution program's instead of EA's-.

 
paul_hughes:

Two ways I can see around this.

1. Have your order management EA's use the order comment rather than a magic number. When opening an order manually, you would have to remember to add a particular comment that your EA's are going to recognize later. If you're using something like mptm to manage your trades, I know that has an option to manage by comment rather than magic number.

2. Write/find/use a script to enter your manual trades and the script could then add a magic number or comment as required. I'd prefer this option since you don't have to remember to type in a comment every time.

It's fairly easy to modify the default scripts (or your EA's or if you have the source code).

A second

Regards, Paul.


Thanks Paul. I'm on to it as we speak.

Hope you got your disappearing EA issue sorted, Sorry I couldn't return the favour...

oz

 
zzuegg:

Hi a script usually doesnt wait for a signal. It gets executed as soon as you drop it on the chart. An advantage of opening orders trough scripts is that you are forced to stick on your moneymanagemnt plan.

Scripts are normally one time execution program's instead of EA's-.


Thanks also zz. A combo may do the trick. I'll let you know how I go...

Cheers,

oz

 

> Is it possible to assign a magic number (or similar) to an EA that is managing a MANUALLY entered position

You have a default Magic Number of zero when you enter a trade manually - so you could track it by that

FWIW

-BB-

 

The attached script generates a magic number based on the currency pair and the timeframe - can't promise you will not have a collision on the magic numbers. If you use the thisMagic() routine in your EA, when ever you open a trade with this script on a chart, the EA will calculate the same magic number for the chart it is on.

I can modify the script and the EA to work together if you want...

Files:
samplebuy.mq4  2 kb
 
serpentsnoir:

The attached script generates a magic number based on the currency pair and the timeframe - can't promise you will not have a collision on the magic numbers. If you use the thisMagic() routine in your EA, when ever you open a trade with this script on a chart, the EA will calculate the same magic number for the chart it is on.

I can modify the script and the EA to work together if you want...


Many thanks Black Snake. I'll take a look tonight. Really appreciate it...

oz