OrderSend error 131 - invalid trade volume

674 views
Skip to first unread message

johnor...@gmail.com

unread,
Nov 15, 2016, 2:58:45 PM11/15/16
to Adaptrade Builder
Trying out Builder.

This does not make sense to me... MT4 is rejecting my orders.

How do I translate MT4 Symbol information to Builder?

In MT4 it says (Symbol -> Specification):
Spread=floating
Digits=2
Contract size=50
Margin percentage=400.0%
Minimal volume=0.01
Maximum volume=20.00
Volume step=0.01

In Builder I've got:
Point Value=50
Tick Size=1
Bid/Ask Spread=20 (average difference between bid/ask in MT4)
Trading Cost Per Share=0

And my position size method is fixed size:
Paramater=1
Limit=1 to 100
Round to nearest 1 shr/cntr
Don't evolve

What is wrong here?

Regards


johnor...@gmail.com

unread,
Nov 15, 2016, 2:59:15 PM11/15/16
to Adaptrade Builder
OK, I think I found the problem...

The generated code contains the following:
double SharesPerLot = 100000;

and..

extern double PSParam = 1.00;
double NShares = PSParam;

double Lots = NShares/SharesPerLot;

So, Lots would be equal to 0.00001, and I am expecting to buy 1 contract.

It looks like it is assumed that because I am using MT4 I must be trading Forex, and the Shares per lot is then set accordingly.

Is this what is happening? Is there a way to avoid/change it so that the number of contracts calculated would be correct?

More importantly, does this impact the validity/feasibility of the generated strategies?

But, MT4 can be used to trade other things; like the CAC, DAX, S&P, etc, etc.

Regards

Michael R. Bryant

unread,
Nov 15, 2016, 3:25:01 PM11/15/16
to adaptrad...@googlegroups.com
That's correct. Since most users of MT4 (or at least my customers) use it for forex, that was my intent when writing the code for it from Builder. If you want to use it for a non-forex market, you should change the SharesPerLot variable to be equal to 1. This will make "lots" the same as "share", which is what you need to match the results in Builder. This change has no effect on the validity of the strategy.

Regards,
Mike Bryant
Adaptrade Software
--
You received this message because you are subscribed to the Google Groups "Adaptrade Builder" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adaptrade-buil...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages