
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I would assume the high lighted section is what have been trying to find.
2011.12.16 15:20:37 2008.01.07 00:00 Kelly Experiment GBPUSD,Daily: Alert: Error opening SELL order : invalid function parameter value
2011.12.16 15:20:37 2008.01.07 00:00 Kelly Experiment GBPUSD,Daily: GBPUSD 1 0 1.9737 20 1.9772 1.9617 12332151
2011.12.16 15:20:37 2008.01.07 00:00 Kelly Experiment GBPUSD,Daily: OrderSend error 4051
2011.12.16 15:20:37 2008.01.07 00:00 Kelly Experiment GBPUSD,Daily: invalid lots amount for OrderSend function
2011.12.16 15:20:34 2008.01.04 00:00 Kelly Experiment GBPUSD,Daily: Alert: Error opening SELL order : invalid function parameter value
2011.12.16 15:20:34 2008.01.04 00:00 Kelly Experiment GBPUSD,Daily: GBPUSD 1 0 1.9724 20 1.9759 1.9604 12332151
2011.12.16 15:20:34 2008.01.04 00:00 Kelly Experiment GBPUSD,Daily: OrderSend error 4051
2011.12.16 15:20:34 2008.01.04 00:00 Kelly Experiment GBPUSD,Daily: invalid lots amount for OrderSend function
2011.12.16 15:20:32 2008.01.03 00:40 Kelly Experiment GBPUSD,Daily: Alert: Error opening BUY order : invalid function parameter value
2011.12.16 15:20:32 2008.01.03 00:40 stdlib GBPUSD,Daily: loaded successfully
2011.12.16 15:20:32 2008.01.03 00:40 Kelly Experiment GBPUSD,Daily: GBPUSD 1 0 1.9829 20 1.9794 1.9949 12332151
2011.12.16 15:20:32 2008.01.03 00:40 Kelly Experiment GBPUSD,Daily: OrderSend error 4051
2011.12.16 15:20:32 2008.01.03 00:40 Kelly Experiment GBPUSD,Daily: invalid lots amount for OrderSend function
2011.12.16 15:20:32 2008.01.03 00:20 Kelly Experiment GBPUSD,Daily: close #1 sell 0.01 GBPUSD at 1.98660 sl: 1.99010 tp: 1.97460 at price 1.98318
2011.12.16 15:20:30 2008.01.02 08:00 Kelly Experiment GBPUSD,Daily: GBPUSD 1 0.01 1.9866 20 1.9901 1.9746 12332151
2011.12.16 15:20:30 2008.01.02 08:00 Kelly Experiment GBPUSD,Daily: 0
2011.12.16 15:20:30 2008.01.02 08:00 Kelly Experiment GBPUSD,Daily: Risk by Optimal f : 0.00 lot (SL : 100pips, Fractional)
2011.12.16 15:20:30 2008.01.02 08:00 Kelly Experiment GBPUSD,Daily: Fractional Kelly (0.25) : 0.00%
2011.12.16 15:20:30 2008.01.02 08:00 Kelly Experiment GBPUSD,Daily: Optimal f (Kelly) : 0.00%
2011.12.16 15:20:30 2008.01.02 08:00 Kelly Experiment GBPUSD,Daily: Profit / Loss Ratio : 0.00
2011.12.16 15:20:30 2008.01.02 08:00 Kelly Experiment GBPUSD,Daily: Average Loss : 0.00 USD
2011.12.16 15:20:30 2008.01.02 08:00 Kelly Experiment GBPUSD,Daily: Average Win : 0.00 USD
2011.12.16 15:20:30 2008.01.02 08:00 Kelly Experiment GBPUSD,Daily: Trades : 0 (Total) / 0 (buy) / 0 (sell)
2011.12.16 15:20:30 2008.01.02 08:00 Kelly Experiment GBPUSD,Daily: open #1 sell 0.01 GBPUSD at 1.98660 sl: 1.99010 tp: 1.97460 ok
2011.12.16 15:20:30 2008.01.02 08:00 Kelly Experiment GBPUSD,Daily: 0
2011.12.16 15:20:30 2008.01.02 08:00 Kelly Experiment GBPUSD,Daily: Risk by Optimal f : 0.00 lot (SL : 100pips, Fractional)
2011.12.16 15:20:30 2008.01.02 08:00 Kelly Experiment GBPUSD,Daily: Fractional Kelly (0.25) : 0.00%
2011.12.16 15:20:30 2008.01.02 08:00 Kelly Experiment GBPUSD,Daily: Optimal f (Kelly) : 0.00%
2011.12.16 15:20:30 2008.01.02 08:00 Kelly Experiment GBPUSD,Daily: Profit / Loss Ratio : 0.00
2011.12.16 15:20:30 2008.01.02 08:00 Kelly Experiment GBPUSD,Daily: Average Loss : 0.00 USD
2011.12.16 15:20:30 2008.01.02 08:00 Kelly Experiment GBPUSD,Daily: Average Win : 0.00 USD
2011.12.16 15:20:30 2008.01.02 08:00 Kelly Experiment GBPUSD,Daily: Trades : 0 (Total) / 0 (buy) / 0 (sell)
Attached is a mock up EA that has the original EA in it just to see was the out puts would be.
its not optimised or very good for that matter.
if you run a demo you will see the Risk by Optimal F starting at 0.00 in moving to -0.19 or something then up to a positive GBPUSD Daily was the pair and for every win it moves up depending on the size of the win and vice versa for the loss.
I have been trying to use the Risk by Optimal F as the lot size for the EA so if there is a - 0.19 that needs to = the minimum lot size for the broker.
I hope that helps out a little
For the Pivot.mq4 file the problem area is shown below (but fixed)
It was giving INVALID_STOPS on both buy and sell orders so I commented out the buy orders, then made the TP=0, then the SL=0, at which point the errors stopped. Hence the SL was the problem.
Without a debugger you have to narrow down the problem area by simplifying the code or adding tests to narrow down the problem area. Sometimes I literally add Print("Got Here") and move that through the code until I find where it gets stuck.
I would assume the high lighted section is what have been trying to find.
Whoever wrote this code (below) ought to be shot ...
The original Kellylot() function was badly indented throughout such that it took longer than necessary to notice that the lotsize trap at the end was being bypassed.
Corrected below.
Hi dabbler
Some days I think I am getting the hang of this coding lark. Then I come onto a forum like this and get a massive reality check I gues its just not in my DNA.
In both instances the code is massively different and very clean and tidy I now understand what you mean be normalizing under the OrderSend().
Now what do I need to do in order to get the kellyLot into the OrderSend().
And I know I need to go through the mql book another couple of times.
Kind Regards
Kiwi
Now what do I need to do in order to get the kellyLot into the OrderSend().
Try this ...
The code now runs without errors, but i doubt it is doing what you want. It seems to be closing orders almost as soon as they are opened and is remarkably unprofitable.
Time to dive in there and really make the code your own. And note that the MLQ4 coding examples are not in any style of C programming that I have seen. (Aarrrgh!!!)
Hi dabbler
Thanks for taking the time to show be the error of my ways so to speak. The only thing that is not working is the lot size is not changing for some reason there is only 0.01 which the below is picking up the error I think
where the Error in lotsize=0.01 happens is where is lot size should increase. well it does on the comments on screen.
2011.12.17 13:23:12 2009.05.07 02:20 Pivot GBPUSD,Daily: Error in lotsize=0.01
2011.12.17 13:23:12 2009.05.07 02:00 Pivot GBPUSD,Daily: Error in lotsize=0.01
2011.12.17 13:23:12 2009.05.07 01:40 Pivot GBPUSD,Daily: Error in lotsize=0.01
2011.12.17 13:23:12 2009.05.07 01:20 Pivot GBPUSD,Daily: Error in lotsize=0.01
2011.12.17 13:23:12 2009.05.07 01:00 Pivot GBPUSD,Daily: Error in lotsize=0.01
2011.12.17 13:23:12 2009.05.07 01:00 Tester: stop loss #112 at 1.51082 (1.50980 / 1.51051)
2011.12.17 13:23:12 2009.05.07 00:40 Pivot GBPUSD,Daily: modify #112 buy 0.01 GBPUSD at 1.51255 sl: 1.51082 tp: 1.52455 ok
2011.12.17 13:23:12 2009.05.07 00:20 Pivot GBPUSD,Daily: modify #112 buy 0.01 GBPUSD at 1.51255 sl: 1.51031 tp: 1.52455 ok
2011.12.17 13:23:12 2009.05.07 00:00 Pivot GBPUSD,Daily: open #112 buy 0.01 GBPUSD at 1.51255 sl: 1.50905 tp: 1.52455 ok
2011.12.17 13:23:12 2009.05.07 00:00 Pivot GBPUSD,Daily: Error in lotsize=0.01
where the Error in lotsize=0.01 happens is where is lot size should increase. well it does on the comments on screen.
2011.12.17 13:23:12 2009.05.07 02:20 Pivot GBPUSD,Daily: Error in lotsize=0.01
2011.12.17 13:23:12 2009.05.07 02:00 Pivot GBPUSD,Daily: Error in lotsize=0.01
2011.12.17 13:23:12 2009.05.07 01:40 Pivot GBPUSD,Daily: Error in lotsize=0.01
2011.12.17 13:23:12 2009.05.07 01:20 Pivot GBPUSD,Daily: Error in lotsize=0.01
2011.12.17 13:23:12 2009.05.07 01:00 Pivot GBPUSD,Daily: Error in lotsize=0.01
2011.12.17 13:23:12 2009.05.07 01:00 Tester: stop loss #112 at 1.51082 (1.50980 / 1.51051)
2011.12.17 13:23:12 2009.05.07 00:40 Pivot GBPUSD,Daily: modify #112 buy 0.01 GBPUSD at 1.51255 sl: 1.51082 tp: 1.52455 ok
2011.12.17 13:23:12 2009.05.07 00:20 Pivot GBPUSD,Daily: modify #112 buy 0.01 GBPUSD at 1.51255 sl: 1.51031 tp: 1.52455 ok
2011.12.17 13:23:12 2009.05.07 00:00 Pivot GBPUSD,Daily: open #112 buy 0.01 GBPUSD at 1.51255 sl: 1.50905 tp: 1.52455 ok
2011.12.17 13:23:12 2009.05.07 00:00 Pivot GBPUSD,Daily: Error in lotsize=0.01
This is totally stupid. IT'S NOT POSSIBLE! AARRRGH ...
We normaliize to 2 digits, compare to a 2 digit value, and it says the answer is wrong and then prints it correctly. Doubting my own sanity i wrote a little script to test it.
This produces no errors. Just delete that test; it is causing trouble unnecessarily. (Probably you could test for < 0.009999 and it would also be fine).
The Kellylot() code is never executed more than once because of this bizarre line ...
Like i said, you need to go through this code and understand what it is doing, or should be doing, in order to fix it.