dabbler:
Well running that in the strategy tester gives me a zero_divide error and no trades at all.
Now I tried with my modification, it opens a position, but gives a lot of OrderModify error 1. Before that, the stop points I set was too small, and it's result was error 130 and endless new position opening. This code is full of bugs, it is a wreck.
when there are no orders present you crash the program with a zero divide.
It also doesn't check the OrderSelect.
Why are you re-checking for OrderSymbol and OrderMagicNumber after you have just rejected trades (with a continue) that do not meet those criteria?
sorry, i can not answer that as i did not write the code. i know it functions well without my added "Ask<Buy_Price" line. i only wanted to limit it from continuing to open orders as the price rose beyond a certain point. i am begining to think it is not possible.
cavesinarizona:
sorry, i can not answer that as i did not write the code. i know it functions well without my added "Ask<Buy_Price" line. i only wanted to limit it from continuing to open orders as the price rose beyond a certain point. i am begining to think it is not possible.
I would recommend that you dump that code and start from scratch. There is a lot of code and it is not well written -- and even if it were well written you wouldn't understand it!
It is better to start off simple and add things as you go. You will then really understand the code and be able to change it to do what you want. It will take a bit of time but you will get to your final goal much faster.
I would recommend that you dump that code and start from scratch. There is a lot of code and it is not well written -- and even if it were well written you wouldn't understand it!
It is better to start off simple and add things as you go. You will then really understand the code and be able to change it to do what you want. It will take a bit of time but you will get to your final goal much faster.
Thanks, sounds like good advice. thanks for your time and help.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
If you call this function
when there are no orders present you crash the program with a zero divide.
It also doesn't check the OrderSelect.
Why are you re-checking for OrderSymbol and OrderMagicNumber after you have just rejected trades (with a continue) that do not meet those criteria?
Well running that in the strategy tester gives me a zero_divide error and no trades at all.
Fix ...
And it now trades.
BUT it is still not good code, and it is giving OrderSend error 4051 with invalid lots amounts.
s
If you call this function
when there are no orders present you crash the program with a zero divide.
It also doesn't check the OrderSelect.
Why are you re-checking for OrderSymbol and OrderMagicNumber after you have just rejected trades (with a continue) that do not meet those criteria?
sorry, i can not answer that as i did not write the code. i know it functions well without my added "Ask<Buy_Price" line. i only wanted to limit it from continuing to open orders as the price rose beyond a certain point. i am begining to think it is not possible.
sorry, i can not answer that as i did not write the code. i know it functions well without my added "Ask<Buy_Price" line. i only wanted to limit it from continuing to open orders as the price rose beyond a certain point. i am begining to think it is not possible.
I would recommend that you dump that code and start from scratch. There is a lot of code and it is not well written -- and even if it were well written you wouldn't understand it!
It is better to start off simple and add things as you go. You will then really understand the code and be able to change it to do what you want. It will take a bit of time but you will get to your final goal much faster.
I would recommend that you dump that code and start from scratch. There is a lot of code and it is not well written -- and even if it were well written you wouldn't understand it!
It is better to start off simple and add things as you go. You will then really understand the code and be able to change it to do what you want. It will take a bit of time but you will get to your final goal much faster.
Thanks, sounds like good advice. thanks for your time and help.