HELP WITH ERROR 4107

Post Reply
fx800
Trader
Posts: 1334
Joined: Sun Dec 04, 2011 4:11 am

Re: Bob Shelley again ea pending orders

Post by fx800 »

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
fx800
Trader
Posts: 1334
Joined: Sun Dec 04, 2011 4:11 am

Re: HELP WITH ERROR 4107

Post by fx800 »

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

:D
User avatar
fxdaytrader
Trader
Posts: 190
Joined: Sun Jun 10, 2012 7:03 am
Location: Poon-Town (germany, se-asia, se-europe) ...

Re: HELP WITH ERROR 4107

Post by fxdaytrader »

but no errors as well? :)
fx800
Trader
Posts: 1334
Joined: Sun Dec 04, 2011 4:11 am

Re: HELP WITH ERROR 4107

Post by fx800 »

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.
fx800
Trader
Posts: 1334
Joined: Sun Dec 04, 2011 4:11 am

Re: HELP WITH ERROR 4107

Post by fx800 »

Not even one trade entry. A couple of missed re-entry trades. Not at the computer, so do not know if any error messages.
fx800
Trader
Posts: 1334
Joined: Sun Dec 04, 2011 4:11 am

Re: HELP WITH ERROR 4107

Post by fx800 »

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.
You do not have the required permissions to view the files attached to this post.
User avatar
fxdaytrader
Trader
Posts: 190
Joined: Sun Jun 10, 2012 7:03 am
Location: Poon-Town (germany, se-asia, se-europe) ...

Re: HELP WITH ERROR 4107

Post by fxdaytrader »

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 :)
fx800
Trader
Posts: 1334
Joined: Sun Dec 04, 2011 4:11 am

Re: HELP WITH ERROR 4107

Post by fx800 »

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.
You do not have the required permissions to view the files attached to this post.
Last edited by Anonymous on Thu Aug 22, 2013 9:30 am, edited 6 times in total.
fx800
Trader
Posts: 1334
Joined: Sun Dec 04, 2011 4:11 am

Re: HELP WITH ERROR 4107

Post by fx800 »

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
User avatar
fxdaytrader
Trader
Posts: 190
Joined: Sun Jun 10, 2012 7:03 am
Location: Poon-Town (germany, se-asia, se-europe) ...

Re: HELP WITH ERROR 4107

Post by fxdaytrader »

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-)
Post Reply

Return to “Coders Hangout”