Help me with 4107 please

 
;)
 
Redael777:
Hi,I wrote an ea which opens positions when, BUY example:

1 - Daily Heikin Ashi's candle [1] closed above open [1].

2 - Same on 4H,1H and 30Min charts but also the closes are above 20 ema.

3 - Signal from MACD.

volume is set to 0.10

But when I tested it gives me 4107 error..

Please advise,thank you
Please copy and paste the error from the Journal/Experts tab or logs, I don't believe the code you have shown will cause that error. 4107 is invalid price, Bid or Ask can't be invalid prices . . . they can be old but not invalid.
 
2013.11.30 19:10:15     2013.01.02 18:20  Heiken Ashi EURJPY,Daily: removed
2013.11.30 19:10:15     2013.01.02 18:20  Heiken Ashi EURJPY,H4: removed
2013.11.30 19:10:15     2013.01.02 18:20  Heiken Ashi EURJPY,H1: removed
2013.11.30 19:10:15     2013.01.02 18:20  Tester: order #1 is closed
2013.11.30 19:10:15     2013.01.02 18:20  Carver V1: stopped because of Stop Out
2013.11.30 19:10:15     2013.01.02 09:00  Carver V1 EURJPY,M30: OrderSend error 4107
2013.11.30 19:10:15     2013.01.02 09:00  Carver V1 EURJPY,M30: invalid price for OrderSend function
2013.11.30 19:10:15     2013.01.02 09:00  Carver V1 EURJPY,M30: open #1 buy 10.00 EURJPY at 115.809 ok
2013.11.30 19:10:15     2013.01.02 09:00  Heiken Ashi EURJPY,M30: loaded successfully
2013.11.30 19:10:15     2013.01.02 09:00  Heiken Ashi EURJPY,H1: loaded successfully
2013.11.30 19:10:15     2013.01.02 09:00  Heiken Ashi EURJPY,H4: loaded successfully
2013.11.30 19:10:15     2013.01.02 09:00  Heiken Ashi EURJPY,Daily: loaded successfully
2013.11.30 19:10:15     Carver V1 inputs: PRange=90; ShieldRange=40; volume=10; 
2013.11.30 19:10:08     TestGenerator: spread set to 32
2013.11.30 19:10:08     Heiken Ashi EURJPY,M30: removed
2013.11.30 19:09:26     2013.01.02 18:11  Heiken Ashi EURJPY,Daily: removed
2013.11.30 19:09:26     2013.01.02 18:11  Heiken Ashi EURJPY,H4: removed
2013.11.30 19:09:26     2013.01.02 18:11  Heiken Ashi EURJPY,H1: removed
2013.11.30 19:09:26     2013.01.02 18:11  Tester: order #1 is closed
2013.11.30 19:09:26     2013.01.02 18:11  Carver V1: stopped because of Stop Out
2013.11.30 19:09:26     2013.01.02 09:00  Carver V1 EURJPY,M30: OrderSend error 4107
2013.11.30 19:09:26     2013.01.02 09:00  Carver V1 EURJPY,M30: invalid price for OrderSend function
2013.11.30 19:09:26     2013.01.02 09:00  Carver V1 EURJPY,M30: open #1 buy 10.00 EURJPY at 115.892 ok
2013.11.30 19:09:26     2013.01.02 09:00  Heiken Ashi EURJPY,M30: loaded successfully
2013.11.30 19:09:26     2013.01.02 09:00  Heiken Ashi EURJPY,H1: loaded successfully
2013.11.30 19:09:26     2013.01.02 09:00  Heiken Ashi EURJPY,H4: loaded successfully
2013.11.30 19:09:23     2013.01.02 09:00  Heiken Ashi EURJPY,Daily: loaded successfully
2013.11.30 19:09:20     Carver V1 inputs: PRange=90; ShieldRange=40; volume=10; 
2013.11.30 19:09:11     TestGenerator: current spread 115 used
2013.11.30 19:09:11     Carver V1: loaded successfully
I am using Alpari for the testing,thanks.
 
What do you think this can be?
 
Redael777: What do you think this can be?
2013.11.30 19:09:26     2013.01.02 09:00  Carver V1 EURJPY,M30: invalid price for OrderSend function
2013.11.30 19:09:26     2013.01.02 09:00  Carver V1 EURJPY,M30: open #1 buy 10.00 EURJPY at 115.892 ok
I think it's because it's not from the code you posted. If those OrderSends failed, your print would have said
...Order was not opened because nn
Instead it says an order was opened ok and then some other OrderSend failed.
 
WHRoeder:
I think it's because it's not from the code you posted. If those OrderSends failed, your print would have said
Instead it says an order was opened ok and then some other OrderSend failed.
Exactly . . .
 
Redael777:
;)
So you found the cause of the issue ?
 
Sorry when I made this post I was a little drunk,thank you for your help,my ea was a mess.
Reason: