To begin with remove the semicolons after an if()
Please avoid leaving so many empty lines in your code and use the styler to tidy up your code. It will make it easier to read and find errors.
I will move this to the MQL4/MT4 section.
OK great, thanks keith!
Thanks for the constructive criticism, ill get right on that
double SellEntry = (Close[LowestCandle]-3);
if the close price is 1.0000 you are setting the entry at minus 2.000
Same with your other variables.
if(OrderType()==OP_BUY)
You must select an order first.
Hi, This is my first ever programme, i keep getting these errors when trying to proof my code.
Could somebody help me sort out the errors and check my code to see if it makes sense?
thank you!
• 3 different empty control statements
if (Trend<0.0);
{
if(EMA13M15<EMA21M15); //true
if(EMA8M15<EMA13M15);
2 errors of return value of 'order modify' should be checked
Hi Mike.
With your invalid prices error, the price needs to be whats availiable; so your SellEntry price variable won't necessarily get filled. Check out Bid and Ask in the MQL4 reference.
This would probably be ok, unless you're creating an order on a different symbol than the chart you're on.
int Sellticket = OrderSend(_Symbol,OP_SELL,0.10,Bid,2,StopLoss,Takeprofit1,NULL,0);
And thinking about your program logic, it looks like...
"If a valid trend, and no orders, then place an order". But then, "If a valid trend, and no orders, then modify an existing order".
That wont work will it?
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi, This is my first ever programme, i keep getting these errors when trying to proof my code.
Could somebody help me sort out the errors and check my code to see if it makes sense?
thank you!
• 3 different empty control statements
if (Trend<0.0);
{
if(EMA13M15<EMA21M15); //true
if(EMA8M15<EMA13M15);
2 errors of return value of 'order modify' should be checked
and when i try to run the program my debug looks like this
2020.03.09 11:51:07.779 2019.04.09 17:19:00 Sell Bot GBPUSD,M15: OrderSend error 4107
2020.03.09 11:51:07.779 2019.04.09 17:19:00 Sell Bot GBPUSD,M15: invalid price for OrderSend function
2020.03.09 11:51:07.587 2019.04.09 17:18:56 Sell Bot GBPUSD,M15: OrderSend error 4107
2020.03.09 11:51:07.587 2019.04.09 17:18:56 Sell Bot GBPUSD,M15: invalid price for OrderSend function
2020.03.09 11:51:07.395 2019.04.09 17:18:52 Sell Bot GBPUSD,M15: OrderSend error 4107
2020.03.09 11:51:07.395 2019.04.09 17:18:52 Sell Bot GBPUSD,M15: invalid price for OrderSend function
2020.03.09 11:51:07.203 2019.04.09 17:18:48 Sell Bot GBPUSD,M15: OrderSend error 4107
2020.03.09 11:51:07.203 2019.04.09 17:18:48 Sell Bot GBPUSD,M15: invalid price for OrderSend function