stevehopwoodforex.com
https://www.stevehopwoodforex.com/phpBB3/
Print view

HELP WITH ERROR 4107
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=2914
Page 9 of 18
Author:  fx800 [ Tue Aug 20, 2013 1:38 pm ]
Post subject:  Re: Bob Shelley again ea pending orders

fxdaytrader wrote:See latest version attached, I think the sl-stuff works now. Set the new external variables as you need them (sl-section).

I think there was one bloop in the tp-section:

Code: Select all

if (OpenTrades > 0) take = lp;
in the original version it should be > 1, but as we have the option to open multiple trades now (maintrade, reentry, stacks) I changed that to

Code: Select all

 if (TradeComment==StackTradeComment) take = lp;
Do not forget to set LoadCustomMASettings=false, otherwise you load differen ma-settings (as I use them on one account for testing) ...
Bob and Shelley Again.v1o.PendingOrders.fxdaytrader.mq4
Many thanks again.

peter
Author:  fx800 [ Wed Aug 21, 2013 6:13 am ]
Post subject:  Re: HELP WITH ERROR 4107

No trades yet from the latest update on H1 time frame.

:D
Author:  fxdaytrader [ Wed Aug 21, 2013 6:21 am ]
Post subject:  Re: HELP WITH ERROR 4107

but no errors as well? :)
Author:  fx800 [ Wed Aug 21, 2013 6:55 am ]
Post subject:  Re: HELP WITH ERROR 4107

fxdaytrader wrote:but no errors as well? :)
None so far :lol: :lol: :lol:

" any other ideas what could be missing? "

May be an outer boundary filter ? No trades if outside xxx ATR from the slow trend ma.
Author:  fx800 [ Wed Aug 21, 2013 4:06 pm ]
Post subject:  Re: HELP WITH ERROR 4107

Not even one trade entry. A couple of missed re-entry trades. Not at the computer, so do not know if any error messages.
Author:  fx800 [ Thu Aug 22, 2013 8:34 am ]
Post subject:  Re: HELP WITH ERROR 4107

One trade entered this am.

Looks like a re-entry,but comments say main entry. This is not an issue for me.

So far no errors.
Author:  fxdaytrader [ Thu Aug 22, 2013 8:54 am ]
Post subject:  Re: HELP WITH ERROR 4107

oha, it opened 2 orders at the same time? :roll:

Try the following please:

go to the code into the function bool TooClose()

find the line (line 3 or 4 there):

Code: Select all

   if (OrdersHistoryTotal() == 0) return(false);
direct under that line insert the following:

Code: Select all

//fxdaytrader, check for pending orders  
if (UsePendingStopOrders) {
 for (int cd = OrdersTotal() - 1; cd >= 0; cd--) {
  if (!OrderSelect(cd, SELECT_BY_POS) ) continue;
  if (OrderMagicNumber() != MagicNumber) continue;
  if (OrderSymbol() != Symbol()) continue;
  if (OrderType() != OP_BUYSTOP) continue;
  if (OrderType() != OP_SELLSTOP) continue;
      
  if (TimeCurrent() - OrderOpenTime() < (PendingOrderHighLowTF * 60)) return(true);
  
 }//end for (int cd = OrdersTotal()
}//end if (UsePendingStopOrders) {
//end fxdaytrader
Not 100% sure, but I think this helps :)
Author:  fx800 [ Thu Aug 22, 2013 9:04 am ]
Post subject:  Re: HELP WITH ERROR 4107

The equity curve of manual trading for BASA using pending orders on H1 over about two weeks on demo 10k account trading 0.2 lots.

Account increased by about 10% This is in spite of very difficult trading environment during which most systems lost money, BASA original included.

I am looking forward to BASA MOD out-performing next month when the market trends. And many thanks to fxdaytrader for your contribution. Keep up the good work.
Author:  fx800 [ Thu Aug 22, 2013 9:19 am ]
Post subject:  Re: HELP WITH ERROR 4107

fxdaytrader wrote:oha, it opened 2 orders at the same time? :roll:

Try the following please:

go to the code into the function bool TooClose()

find the line (line 3 or 4 there):

Code: Select all

   if (OrdersHistoryTotal() == 0) return(false);
direct under that line insert the following:

Code: Select all

//fxdaytrader, check for pending orders  
if (UsePendingStopOrders) {
 for (int cd = OrdersTotal() - 1; cd >= 0; cd--) {
  if (!OrderSelect(cd, SELECT_BY_POS) ) continue;
  if (OrderMagicNumber() != MagicNumber) continue;
  if (OrderSymbol() != Symbol()) continue;
  if (OrderType() != OP_BUYSTOP) continue;
  if (OrderType() != OP_SELLSTOP) continue;
      
  if (TimeCurrent() - OrderOpenTime() < (PendingOrderHighLowTF * 60)) return(true);
  
 }//end for (int cd = OrdersTotal()
}//end if (UsePendingStopOrders) {
//end fxdaytrader
Not 100% sure, but I think this helps :)
Thanks.

:D
Author:  fxdaytrader [ Thu Aug 22, 2013 11:32 am ]
Post subject:  Re: HELP WITH ERROR 4107

During the meantime I extended the version (implemented utc-stuff to stop trading xyz hours before market closes on friday (close time is computed, so no time-calculation of the user needed).
Runs on demo on H4 and on another demo on H1, if everything works as desired I will publish that version on the beginning of the next week. 8-)
All times are UTC Page 9 of 18