Thanks Charvo. After your message checked the code more carefully and realized that when the pipstep is on, it also implies that all trades must be in profit. I was confused by the 'else', but
does it properly.
Onto my ideas. I have some ideas which I wonder may be worth exploring:
Idea A:
how to deal with re-setting profit targets when it executes a "cut-loser'. I have a different concept: use just the basket profit (open trades on the EA's magic number) to decide upon closing, not a global variable of last flat equity plus some amount. Without the cut-losers and no other trades on the account, it should be equivalent, right? (Correct me if my understanding is wrong).
If we are doing basket take-profits on the outstanding open balance, then it means that if we cut a loser, we would then have to add the value of that loser to the required balance profit to execute a take-profit.
The general problem is that after some losers, the EA requires an ever more distant profit target to close, and this can mean ever more risk, or with the x-factor/pipstep turned on, a freezup as all symbols go into loserdom and nothing changes. My suggestion is then to add only some fraction smaller than one of the "cut loser amount" to the required basket profit to close.
In implementation we may have two variables, one the base required basket profit, and the additional needed on account of cut-losers. Furthermore, one may want to limit the total required profit to be some multiple (3?) of the base, e.g. (symbolically)
NetBasketProfitNeeded = MathMin( BaseBasketProfit + AdditinonalBasketProfit, SomeMultiple*BaseBasketProfit);
The idea is to keep the EA grinding and working, even if it means butching up and taking some losses.
Idea B:
Cutting losers based on some kind of fast moving average/filter (Hull MA?) instead of just the price. Maybe a quick spike down shouldn't mean that you need to cut a loser instantaneously.
Idea C:
Making sure only one trade gets placed per hour. There can be some cases when this doesn't quite happen. I've seen it in my demo and usually it ends poorly. If two trades are 'nearly equal' in P&L and both have some chance to happen in the first minute, then they're probably short term correlated---and by murphy's law, they seem to lose together.
This would be easy to accomplish with a persistent 'datetime' global variable which stores the time of the last successful trade. If it is less than say 50 minutes ago, then don't open any new trades.
I of course still advocate using my balanced basket mod (or at least trying it), it doesn't seem theoretically sound to me without it.
Also, I wouldn't go by demo profits---it's irrelevant without knowing how much risk was taken to get it. If you need a single number in a nutshell, I prefer profit factor---always making sure to add in p's and l's from open trades (very important!). Sum up all profits (including opens) divided by all losses (including opens). It doesn't consider ordering, but otherwise it's reasonably reliable summary statistic.
Thoughts? Likes? discussions? problems?
cheers
Inserted Code
if (UsePipStep) { if (OrderType() == OP_BUY && (MarketInfo(OrderSymbol(), MODE_BID) - OrderOpenPrice()) < PipStep * MarketInfo(OrderSymbol(), MODE_POINT)) return(false); if (OrderType() == OP_SELL && (OrderOpenPrice() - MarketInfo(OrderSymbol(), MODE_ASK)) < PipStep * MarketInfo(OrderSymbol(), MODE_POINT)) return(false); } else { if (OrderProfit() <= 0.0) return(false); }
Onto my ideas. I have some ideas which I wonder may be worth exploring:
Idea A:
how to deal with re-setting profit targets when it executes a "cut-loser'. I have a different concept: use just the basket profit (open trades on the EA's magic number) to decide upon closing, not a global variable of last flat equity plus some amount. Without the cut-losers and no other trades on the account, it should be equivalent, right? (Correct me if my understanding is wrong).
If we are doing basket take-profits on the outstanding open balance, then it means that if we cut a loser, we would then have to add the value of that loser to the required balance profit to execute a take-profit.
The general problem is that after some losers, the EA requires an ever more distant profit target to close, and this can mean ever more risk, or with the x-factor/pipstep turned on, a freezup as all symbols go into loserdom and nothing changes. My suggestion is then to add only some fraction smaller than one of the "cut loser amount" to the required basket profit to close.
In implementation we may have two variables, one the base required basket profit, and the additional needed on account of cut-losers. Furthermore, one may want to limit the total required profit to be some multiple (3?) of the base, e.g. (symbolically)
NetBasketProfitNeeded = MathMin( BaseBasketProfit + AdditinonalBasketProfit, SomeMultiple*BaseBasketProfit);
The idea is to keep the EA grinding and working, even if it means butching up and taking some losses.
Idea B:
Cutting losers based on some kind of fast moving average/filter (Hull MA?) instead of just the price. Maybe a quick spike down shouldn't mean that you need to cut a loser instantaneously.
Idea C:
Making sure only one trade gets placed per hour. There can be some cases when this doesn't quite happen. I've seen it in my demo and usually it ends poorly. If two trades are 'nearly equal' in P&L and both have some chance to happen in the first minute, then they're probably short term correlated---and by murphy's law, they seem to lose together.
This would be easy to accomplish with a persistent 'datetime' global variable which stores the time of the last successful trade. If it is less than say 50 minutes ago, then don't open any new trades.
I of course still advocate using my balanced basket mod (or at least trying it), it doesn't seem theoretically sound to me without it.
Also, I wouldn't go by demo profits---it's irrelevant without knowing how much risk was taken to get it. If you need a single number in a nutshell, I prefer profit factor---always making sure to add in p's and l's from open trades (very important!). Sum up all profits (including opens) divided by all losses (including opens). It doesn't consider ordering, but otherwise it's reasonably reliable summary statistic.
Thoughts? Likes? discussions? problems?
cheers