Multi 10:4 Trader EA

Post Reply
Dewey McG
Trader
Posts: 435
Joined: Sat Nov 26, 2011 4:20 pm
Location: Tampa FL

Re: Multi 10:4 Trader EA

Post by Dewey McG »

Same problem here
User avatar
slipshod
Trader
Posts: 404
Joined: Tue Dec 27, 2011 9:14 am
Location: Australia

Re: Multi 10:4 Trader EA

Post by slipshod »

Hi Andy, great work - I'm going to try this out on demo simply because it looks so awesome :)

One thing I noticed immediately was a continual stream of the following error:-
Multi_10_4_EAv1.06 USDJPY_H4: invalid price for OrderSend function

Might I suggest adding the following three lines of code early in the SendSingleTrade function? The error went away once I inserted these & a slew of pending trades were created.

Code: Select all

Edit: fxdaytrader's solution below is much better
Also, what timeframe should this be run on, or does it not matter?
Last edited by slipshod on Fri Mar 15, 2013 8:18 am, edited 1 time in total.
User avatar
Sojourner
Trader
Posts: 105
Joined: Fri Apr 27, 2012 7:36 pm

Re: Multi 10:4 Trader EA

Post by Sojourner »

This is so frikken awesome! Great work! :D
Bader
Trader
Posts: 20
Joined: Fri Mar 23, 2012 8:46 pm

Re: Multi 10:4 Trader EA

Post by Bader »

Thanks Andy - fantastic work
danny_pip
Trader
Posts: 15
Joined: Thu Dec 08, 2011 8:48 pm

Re: Multi 10:4 Trader EA

Post by danny_pip »

Mr Long, this looks really great; I'm going to test it right now !
I'm really surprised by the interface. Great work !!!!

Thanks and god bless you !
User avatar
fxdaytrader
Trader
Posts: 190
Joined: Sun Jun 10, 2012 7:03 am
Location: Poon-Town (germany, se-asia, se-europe) ...

Re: Multi 10:4 Trader EA

Post by fxdaytrader »

slipshod wrote: Might I suggest adding the following three lines of code early in the SendSingleTrade function? The error went away once I inserted these & a slew of pending trades were created.

Code: Select all

	price = NormalizeDouble(price, Digits);
	stop = NormalizeDouble(stop, Digits);
	take = NormalizeDouble(take, Digits);
No, instead of using NormalizeDouble you should use the following (see HERE for further explanation):

Code: Select all

//Open price for pending order must be adjusted to be a multiple of ticksize, not point, and on metals they are not the same.
//see also http://forum.mql4.com/45425#564188
double NormalizePrice(double p){
  double ts = MarketInfo(Symbol(), MODE_TICKSIZE);
 return(MathRound(p/ts)*ts );
}
;)
User avatar
slipshod
Trader
Posts: 404
Joined: Tue Dec 27, 2011 9:14 am
Location: Australia

Re: Multi 10:4 Trader EA

Post by slipshod »

fxdaytrader wrote:No, instead of using NormalizeDouble you should use the following (see HERE for further explanation):

Code: Select all

//Open price for pending order must be adjusted to be a multiple of ticksize, not point, and on metals they are not the same.
//see also http://forum.mql4.com/45425#564188
double NormalizePrice(double p){
  double ts = MarketInfo(Symbol(), MODE_TICKSIZE);
 return(MathRound(p/ts)*ts );
}
;)
Even better ... thanks! Actually my "solution" would have been wrong anyway, as the "Digits" would have related to whatever pair you're running the EA from rather than the pair being traded.

Edit: The EA needs the symbol passed into it, hence the function would need to be...

Code: Select all

double NormalizePrice(string symbol, double p)
{
   double ts = MarketInfo(symbol, MODE_TICKSIZE);
   return(MathRound(p/ts)*ts );
}
and therefore its calls from SendSingleTrade() ...

Code: Select all

price = NormalizePrice(symbol, price);
stop = NormalizePrice(symbol, stop);
take = NormalizePrice(symbol, take);
Disclaimer: I'm too busy right now to see if this actually works.
Last edited by slipshod on Fri Mar 15, 2013 8:37 am, edited 2 times in total.
MrLong

Re: Multi 10:4 Trader EA

Post by MrLong »

allisonmagic wrote:ok so, the MM on this thing is kinda buggy.. price hit the 240 and never closed my trade.. that was my SL..
I can only think the trade was taken with strealth turned on and then switched off while the trade had been sent. The stealth switch needs to be on to manage the trades.
MrLong

Re: Multi 10:4 Trader EA

Post by MrLong »

philcs65 wrote:I am having the same problem with OrderSend function.

"2013.03.14 22:18:31 Multi_10_4_EAv1.06 AUDCAD,H4: invalid price for OrderSend function"

Running on a Cowboy IBFX (us) demo account. I have tried std and micro account without success.

Using OTB settings except changing magic number from "0".
Likely a broker problem.
User avatar
slipshod
Trader
Posts: 404
Joined: Tue Dec 27, 2011 9:14 am
Location: Australia

Re: Multi 10:4 Trader EA

Post by slipshod »

MrLong, in case you missed them, the posts by myself and fxdaytrader provide code snippets that fix the "invalid price for OrderSend" error.
Post Reply

Return to “Nanningbob 10.x”