Done, thanks.fxdaytrader wrote:Regarding your 130-error try the following please:
In the CountOpenTrades()-function look for that line (must be line number ~2507):
That code replace with this:Code: Select all
if (MaxTradesAllowed > 1)
I am not 100% sure if it helps, but I think it is worth a try.Code: Select all
if (OrderComment()==StackTradeComment && MaxTradesAllowed > 1 && (OrderType()==OP_BUY || OrderType()==OP_SELL)) //fxdaytrader
In your logfile I found another error:
cannot open file 'C:\FOREX Empty4\E-GLOBAL\experts\Bob and Shelley Again.v1o.PendingOrders.fxdaytrader 19-8-2013 2.ex4', expert was not reloaded
The way I try to solve that kind of problems when I download a new mq4-file: Copy the mq4-file in the desired directory (e.g. experts/). Then load another file from your Empty4 (rightclick - edit) in the editor, press F5 key to compile (it seems that all files will be compiled, or at least the files where no .ex4 exists) ...
HELP WITH ERROR 4107
-
fx800
- Trader
- Posts: 1334
- Joined: Sun Dec 04, 2011 4:11 am
Re: HELP WITH ERROR 4107
-
fx800
- Trader
- Posts: 1334
- Joined: Sun Dec 04, 2011 4:11 am
Re: HELP WITH ERROR 4107
What do you mean by " Then load another file from your Empty4 " ?fxdaytrader wrote:Regarding your 130-error try the following please:
In the CountOpenTrades()-function look for that line (must be line number ~2507):
That code replace with this:Code: Select all
if (MaxTradesAllowed > 1)
I am not 100% sure if it helps, but I think it is worth a try.Code: Select all
if (OrderComment()==StackTradeComment && MaxTradesAllowed > 1 && (OrderType()==OP_BUY || OrderType()==OP_SELL)) //fxdaytrader
In your logfile I found another error:
cannot open file 'C:\FOREX Empty4\E-GLOBAL\experts\Bob and Shelley Again.v1o.PendingOrders.fxdaytrader 19-8-2013 2.ex4', expert was not reloaded
The way I try to solve that kind of problems when I download a new mq4-file: Copy the mq4-file in the desired directory (e.g. experts/). Then load another file from your Empty4 (rightclick - edit) in the editor, press F5 key to compile (it seems that all files will be re-compiled, or at least the files where no .ex4 exists) ...
Do you mean re-load the file by compiling it again.
I have checked the experts folder and the .ex4 file is there.
-
fx800
- Trader
- Posts: 1334
- Joined: Sun Dec 04, 2011 4:11 am
Re: HELP WITH ERROR 4107
I have set stop loss to ATR PERI0OD = 20, ATR TIME FRAME =1440, SLATRMULTIPLIER =1.
PO HAS SL = 0.00000
2013.08.20 12:00:01 Bob and Shelley Again.v1o.PendingOrders.fxdaytrader 19-8-2013 2 NZDUSD,H1: stoporder debug: OP_SELLSTOP order entry: 0.7972 | stop: 0.0000 | take: 0.7672 | expiration: 2013.08.20 14:00
2013.08.20 12:00:09 Bob and Shelley Again.v1o.PendingOrders.fxdaytrader 19-8-2013 2 NZDUSD,H1: modify #142638458 sell stop 0.20 NZDUSD at 0.7972 sl: 0.0000 tp: 0.7672 ok
I have now set the ea to use hard sl =100.
PO HAS SL = 0.00000
2013.08.20 12:00:01 Bob and Shelley Again.v1o.PendingOrders.fxdaytrader 19-8-2013 2 NZDUSD,H1: stoporder debug: OP_SELLSTOP order entry: 0.7972 | stop: 0.0000 | take: 0.7672 | expiration: 2013.08.20 14:00
2013.08.20 12:00:09 Bob and Shelley Again.v1o.PendingOrders.fxdaytrader 19-8-2013 2 NZDUSD,H1: modify #142638458 sell stop 0.20 NZDUSD at 0.7972 sl: 0.0000 tp: 0.7672 ok
I have now set the ea to use hard sl =100.
- 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
Did you set the external variable StopLossPips to 0?
Set it back to 100, ... It is because of the logics in the calculatestoploss()-function.
Set it back to 100, ... It is because of the logics in the calculatestoploss()-function.
-
MrLong
Re: HELP WITH ERROR 4107
Hi,
I had the same problems with Multi 10_4 EA.
Then check before sending the long order.
Then check before sending the short order.
Andy
I had the same problems with Multi 10_4 EA.
Code: Select all
double stopLevel = (MarketInfo(Symbol(), MODE_SPREAD) + MarketInfo(Symbol(), MODE_STOPLEVEL)) * MarketInfo(Symbol(), MODE_POINT);
Code: Select all
if ((Ask + stopLevel) >= price ) return;
Code: Select all
if (price >= (Bid - stopLevel)) return;
-
fx800
- Trader
- Posts: 1334
- Joined: Sun Dec 04, 2011 4:11 am
Re: HELP WITH ERROR 4107
StopLossPips has been re-set to 100.fxdaytrader wrote:Did you set the external variable StopLossPips to 0?
Set it back to 100, ... It is because of the logics in the calculatestoploss()-function.
I was using atr sl previously but seems it is causing problems.
Last edited by Anonymous on Tue Aug 20, 2013 12:00 pm, edited 1 time in total.
-
fx800
- Trader
- Posts: 1334
- Joined: Sun Dec 04, 2011 4:11 am
Re: HELP WITH ERROR 4107
Many thanks for your input.MrLong wrote:Hi,
I had the same problems with Multi 10_4 EA.
Then check before sending the long order.Code: Select all
double stopLevel = (MarketInfo(Symbol(), MODE_SPREAD) + MarketInfo(Symbol(), MODE_STOPLEVEL)) * MarketInfo(Symbol(), MODE_POINT);Then check before sending the short order.Code: Select all
if ((Ask + stopLevel) >= price ) return;AndyCode: Select all
if (price >= (Bid - stopLevel)) return;
peter
- 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
yes, it is because of the logics, simplified it looks like that:fx8000 wrote:StopLossPips has been re-set to 100.fxdaytrader wrote:Did you set the external variable StopLossPips to 0?
Set it back to 100, ... It is because of the logics in the calculatestoploss()-function.
I was using atr sl previously but seems it is causing problems.
Code: Select all
if (stoploss NOT 0)
THEN check if (AtrPeriod GREATER THAN 0)
THEN calculate atr-stoploss
Thanks Mr. Long for the stoplevel-hint, I will implement it (within the next update).
fx8000 what do you think about using ATR for SL for stacking trades? Or any other ideas what could be missing?
-
fx800
- Trader
- Posts: 1334
- Joined: Sun Dec 04, 2011 4:11 am
Re: HELP WITH ERROR 4107
using ATR for SL for stacking trades?fxdaytrader wrote:yes, it is because of the logics, simplified it looks like that:fx8000 wrote:StopLossPips has been re-set to 100.fxdaytrader wrote:Did you set the external variable StopLossPips to 0?
Set it back to 100, ... It is because of the logics in the calculatestoploss()-function.
I was using atr sl previously but seems it is causing problems.
I can change that somewhen later ...Code: Select all
if (stoploss NOT 0) THEN check if (AtrPeriod GREATER THAN 0) THEN calculate atr-stoploss
Thanks Mr. Long for the stoplevel-hint, I will implement it (within the next update).
fx8000 what do you think about using ATR for SL for stacking trades? Or any other ideas what could be missing?
Great idea.
peter
- fxdaytrader
- Trader
- Posts: 190
- Joined: Sun Jun 10, 2012 7:03 am
- Location: Poon-Town (germany, se-asia, se-europe) ...
Bob Shelley again ea pending orders
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:
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
Do not forget to set LoadCustomMASettings=false, otherwise you load differen ma-settings (as I use them on one account for testing) ...
I think there was one bloop in the tp-section:
Code: Select all
if (OpenTrades > 0) take = lp;Code: Select all
if (TradeComment==StackTradeComment) take = lp;You do not have the required permissions to view the files attached to this post.