Hey Guys,
Re: Close trades on Friday —
Funny, SandyBeach, I already started working on an add on “CloseWinnersOnFriday = true;” I figured I would not close losers, and give them time to profit. But it could be both either/or. “CloseAllTradesOnFriday = true;”
I’m working on getting the GMT time automatically, because close time will be different for different platform/servers. In fact, I put it in my EA for closing my trades Friday, but it failed, because even though, my platform is trading GMT+3, it stopped trading at 23:59, which would be 20:59 (i.e. 21:00 GMT) but looking at the the ForexMarketHours website, trading is supposed to stop at 22:00 GMT. So it stopped an hour early and my trades were not closed. But my technical mind over rode my experiential mind, because I know the market closes at 2pm PST, which is 21:00 GMT.
Well, anyway, there’s code that can pull GMT from MT4 with some calculations, and I can use that for closing time or I could put a setting for “Local_Close_Time” and use computers LocalTime() function to close when you say it will.
re: opening new trades each day —
The EA will not open a new trade if one is already running in its current format. So if you have an open long trade and a new setup posts, a new trade will not open. Don’t confuse an open trade with a PENDING Trade. If the new day candle setup is a reversal, the EA will close the opposing PENDING trade and open a new one in the correct direction.
re: the stoploss adjustments based on the fibs, and if the fibs change, will the stop-loss settings –
Actually, I think this might be a problem. Because the EA will update the fib, even if a trade is open. So, as we speak, I just move the code that opens the fib and setting to only happen IF there is no OPEN trade. It SHOULD adjust itself, long or short, if only a pending trade is open.
It’s a little of Chicken and Egg thing. At present, if you’re currently in a trade, you’re in it until it closes properly, unless you manually close it.
re: multiple currency pairs on one chart –
First: It can be done for forward and live but NOT on backtesting. The backtesting engine can only see values of the CURRENT chart pair. That was the problem with the lot calculator getting “zero divide” error. It was trying to see value of other currency to determine the base currency value.
Second: it slows things down, and all your pairs trading depend on the new “tick” of the chart the EA is on. So if you have the EA on say, EURUSD, and for some reason, that chart is sitting silent, but the AUDCHF is kicking but ticking away, the EA will miss all those trades. Having the EA on each chart/pair is the best way not to miss any active pair’s trades.
It does not simplify anything having them all trade on one chart. If you want the number of open trades to be restricted, that’s no problem. Just adding in "MaxTrades = " setting can be done and calculated.
In fact, something I mentioned to Mitchell, re: RiskPercent… if you risk 2% and have 6 trades open, you are risking 12%, not 2%. So I already added the option to monitor number of open trades and divide the RiskPercentage by open trades, so as each new trade opens, the RiskPercent gets reduced. To do that, I had to calculate all open trades on different charts, based on MagicNumber and Comment. The same calculation can be used to limit total number of open trades.
Mitchell brought up one point about some jpy pair on backtest. I’m thinking it must have been due to a Monday Gap open that made for a massive StopLoss and TakeProfit. The only way to avoid that at the moment is to select False for Trade_Monday. Guess you can set the Trade_Monday = false by default, then based on each chart you look at, if there is no nasty Gap, you can turn the setting to Trade_Monday = True for that chart and the EA go to work.
re: 2012.09.07 1355 ZZ_Blizard_ZZ_V1.3 EURUSD,M5: ERROR: BUY OrderSend for EURUSD failed with error (130): invalid stops –
I’m not sure what happened. This usually if the stop is too close, which I though I protected against. Or the format is too many digits, also thougth I protected. Only thing I can think if would be a squshed fib, which if you’re using 30 pip minimum fibo size, it shouldn’t happen.
All I can say is watch for it again and see if you can reproduce it and/or determine a common condition causing it. Then we can fix it.
re: trading on 4 hr chart – except for the “Trade Max 1 per day” setting, this EA doesn’t know what timeframe it is on. So if you set that to False, it should tarde the 4hr chart as well. I haven’t tried testing it however. Throw it on a demo and let me know what explodes
Ok, so coming up, a version including:
- option to defray the risk over open trade number. Obviously, the first trade will do full risk calc. Second trade will cut it in half, third in thirds, etc. So, it won’t be a true RiskPercent over all open trades, but it will progressively reduce risk as each new trades opens. So, just as estimate, if you have 2% risk and open 4 trades, it will be 2%, then 1%, then 0.33% then 0.25%. Guess you’d haved to add those up for 3.58% over all risk, instead of 4x2%=8% you would have had otherwise.
- Option to Close_Winning_Trades_Friday and/or Close_All_Trades_Friday
I think its best at this time to let mid-week open trades run, and leave it to you to manually close trades at end-of-day or start-of-new-day, because you might be pretty unhappy if a trend was ripping unhindered to 400% profit, but the EA closed it mid-stride, and you could not get back in, because Pending Order entry level would already be passed, or you might just have to wait a day for a new setup anyway.
And, I still need to test, it, but I belielve I set up the fibs NOT to redraw if a actual trade is open.
hmmm… here is the chicken egg thing. If it will not redraw fibs, and you refresh your charts, the fib will disappear, and not redraw for your adjusting closing stops. If it does redraw, but to new values, it will change your closing stop numbers.
Ah ha, got it. On refreshing a chart with an open trade, I can just take the open price, and the 400% target price and reconstruct the fib base on that.
Will see how this works out.
Will let you know.
Jim