Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not enough money for demo account #341

Open
copypasteearth opened this issue Jul 26, 2022 · 15 comments
Open

Not enough money for demo account #341

copypasteearth opened this issue Jul 26, 2022 · 15 comments
Assignees
Milestone

Comments

@copypasteearth
Copy link

copypasteearth commented Jul 26, 2022

Hi Im trying to setup EA with mt4, and every time it tries to trade there is this error
2022.07.26 19:01:04.033 EA31337-Lite-v2.010 EURUSD,M1: 2022.07.27 02:00:53: ERROR: Trade::OrderAdd:663: Cannot add order!; Code: 134, Msg: Not enough money.

Maybe its something im doing wrong, I log into my demo account and see this when I connect the expert
bot

This is in the oanda specific MT4
Thank you for your time

@kenorb
Copy link
Member

kenorb commented Jul 27, 2022

Are you running with the default settings? It could only happen when you set lot size too large. Set 'Lot size' to '0' in EA's parameters, if it's already, otherwise set to minimal of 0.01 (it's possible auto lot calculate fails due to specific broker settings).

Can you also paste the initial screen before that right after start (which should include values with Market values).

@kenorb kenorb added this to the v2.012 milestone Jul 27, 2022
@copypasteearth
Copy link
Author

@kenorb I had the lot size set at 1000, I thought it was units, Im really new to this, so I set lot size to 0.01 and everything is good now. It has traded a bunch of times but there are like 100s of these messages popping up, can you tell me what this means?
2022.07.27 05:10:00.339 EA31337-Lite-v2.010 EURUSD,M1: 2022.07.27 12:09:06: ERROR: Trade::OrderAdd:663: Cannot add order!; Code: 149, Msg: An attempt to open an order opposite to the existing one when hedging is disabled

@copypasteearth
Copy link
Author

Im getting this also
2022.07.27 05:03:03.472 EA31337-Lite-v2.010 EURUSD,M1: 2022.07.27 12:02:01: WARNING: Order::OrderModify:1086: Failed to modify order (#299436977/p:0/sl:1.01261/tp:0/code:136).; EURUSD,1.01424,1.0141,0,0,1e-05,0.0001,1e-05,1e-05,1,0,0,5,17,0,100000,0.01,100000,0.01,0,-0.55,0.06,0,0,0

@copypasteearth
Copy link
Author

@kenorb How can I limit EA to one order at a time? I think that would solve the problem

@copypasteearth
Copy link
Author

It is not being able to close later orders other than earlier orders and its getting stuck trying to close a more recent order when there are earlier orders

@kenorb
Copy link
Member

kenorb commented Jul 27, 2022

  • 1000 value for lot size is wrong, so there is some EA's miscalculation based on the broker's market values.
  • error code 136 sounds like related to Off quotes as per https://book.mql4.com/appendix/errors, sounds like another miscalculation or price changing too quickly

An attempt to open an order opposite to the existing one when hedging is disabled

It seems your broker doesn't support hedging. It's not recommended to use brokers that don't support it.

For the workaround, you can change Signal open filter to 40 as per https://github.com/EA31337/EA31337/wiki/Input-parameters to activate 8th filter (do not open trades when there are opposite active trades).

@copypasteearth
Copy link
Author

@kenorb I am using Oanda demo account

@copypasteearth
Copy link
Author

@kenorb Im trying your workaround now, Ill let you know how it goes, it may be a US thing the mail says "filling order is against FIFO requirement". thats in the old case, ill let you know how the workaround works. Can you tell me a broker that this would definetly work with if it is a oanda thing, or one that has the hedging option?

@copypasteearth
Copy link
Author

@kenorb yeah setting 40 did not work. It is still doing multiple orders. Is there a way i can make it only deal with one order at a time?

@kenorb
Copy link
Member

kenorb commented Jul 27, 2022

It is still doing multiple orders. Is there a way i can make it only deal with one order at a time?

That filter is per each strategy, try to set only one strategy for the whole EA (other set to None), then try SOF filter=40.

@kenorb
Copy link
Member

kenorb commented Jul 27, 2022

it may be a US thing the mail says "filling order is against FIFO requirement"

If that's a US thing, not sure if you can do much. In EU most of the broker can trade with hedging.

@copypasteearth
Copy link
Author

@kenorb this is what I have set, I set the 40, and disabled the other strategies and it is still opening multiple orders
Screen Shot 2022-07-27 at 8 04 55 PM

@kenorb
Copy link
Member

kenorb commented Jul 28, 2022

opening multiple orders

The configuration looks fine. Opening multiple orders should be fine as long they're in the same direction. If you see in the different direction (buy+sell) at the same time (generating hedging error), then it's not good, so something needs fixing.

@copypasteearth
Copy link
Author

It tries to modify the orders and I get the FIFO error again

@kenorb kenorb modified the milestones: v2.012, v2.013 Dec 20, 2022
@kenorb kenorb self-assigned this Jul 8, 2023
@kenorb
Copy link
Member

kenorb commented Aug 2, 2023

Please test if the issue still persist in the new released v2.013.

@kenorb kenorb modified the milestones: v2.013, v3.000 Aug 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants