Scaling in and out

 

Hi I'm new to the MQL4 community and platform.

Can an EA be programmed to scale in and out of positions?

Say buy three contracts, then have multiple exit conditions for each contract etc.

Thanks.

 
Rapidedward:

Hi I'm new to the MQL4 community and platform.

Can an EA be programmed to scale in and out of positions?

Say buy three contracts, then have multiple exit conditions for each contract etc.

Thanks.

Yep of course, "everything" a human trader can do is possible to encode it into an automate form. Just a matter of how, or time and work you put in, or skills and understanding of combined strategies... But I've seen EA's scale in and out myself so yeah its possible, though it was programmed with TradeStation, I'm sure it can be done with mql4 also. Find the right programmer and he can do whatever you please!


mank

 
mank:

Yep of course, "everything" a human trader can do is possible to encode it into an automate form.

If you are a visual manual trader that draws trend-lines, heads-and-shoulders, flags, breakouts, waves, these things are a bit difficult to translate into code because people usually can't agree exactly on what they are supposed to look like in the first place.

 
Rapidedward:

Hi I'm new to the MQL4 community and platform.

Can an EA be programmed to scale in and out of positions?

Say buy three contracts, then have multiple exit conditions for each contract etc.

Thanks.

I am struggling with this too. Would someone please answer the following:


1. In the "Book" there are complex examples to track the trades: Terminal(), Event(), ... Is there a SIMPLER way to find out if a pending order was filled or not? Tradestation Easylanguage provides the MarketPosition function. Is there a parallel to that in MQL4?


For those not familiar with Easylanguage, in backtesting or real live trading, you can call MarketPosition (no ticket#, no parameters, ...). If it returns 0, you are flat and have no open positions in that security, if it returns 1, you are long, if it returns -1 you are short. That's it.


2. Now that we "somehow" (?) know the pending order was filled and for e.g. we are 3 lots long, we want to exit 1 lot at profit target 1 and the rest at profit target 2. How do we do this in MQL4?


Thanks

 

Hi,

I’m new to the ForEx and programming in it as well.

Though this isn’t exactly the solution that you are looking for, there is a ForEx EA company that has a solution to your problem: http://www.pipboxer.com/comparison.php They have a couple of reasonably priced specialized EA utilities that work alone OR in conjunction with other EAs:

*PBME: A MultiTrade Exit routine such as you are looking for

*PB SARS exit routine. I’m not sure if this is there PBSE utility or if they have discontinued it.

PBTS: Is a ‘2 stage’ Trailing Stop Loss

* I have these two but have never used them.

Being commercial products, they are of course compiled and not the source code.

Regardless of your approach, Good luck with this.

 
DougRH4x:

Hi,

I’m new to the ForEx and programming in it as well.

Though this isn’t exactly the solution that you are looking for, there is a ForEx EA company that has a solution to your problem: http://www.pipboxer.com/comparison.php They have a couple of reasonably priced specialized EA utilities that work alone OR in conjunction with other EAs:

*PBME: A MultiTrade Exit routine such as you are looking for

*PB SARS exit routine. I’m not sure if this is there PBSE utility or if they have discontinued it.

PBTS: Is a ‘2 stage’ Trailing Stop Loss

* I have these two but have never used them.

Being commercial products, they are of course compiled and not the source code.

Regardless of your approach, Good luck with this.

Thanks. I don't need a blackbox. All I need is guidance and hints and at best example codes.