
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
No, you don't need arrays. The solution has already been given to you, but you have failed to apply it properly.
I repeat, read it again and don't say that the "professors" did not understand you. They understood your request just fine.
No, you don't need arrays. The solution has already been given to you, but you have failed to apply it properly.
I repeat, read it again and don't say that the "professors" did not understand you. They understood your request just fine.
I edited the code a bit again
But now it returns the same amount of profit related to the same order
I edited the code a bit again
But now it returns the same amount of profit related to the same order
Remove the OR comparision.
TP variable already is Zero, and having that OR inside the while does not make sense.
Change to this:
if(OrderTakeProfit() > TP)
On the second While, change this:
if(OrderTakeProfit() != TP)
to this:
if(OrderTakeProfit() < TP)
And you are passing the SAME TP value to Order itself.
This has to be:
The rest seems fine.
PS: for SELL orders, invert the logic:
if(OrderTakeProfit() > TP)
UPDATE: Why are you changing the StopLoss too? I can notice on the picture spreadsheet that SL is a complete mess.
You are changing it doing sequencia loops. Every time the while is run, it will subtract the BID value from the current StopLoss value.. on the next run, it will subtract again... and again..
This is wrong.. the SL Value will become negative at some point.
Dont change SL, if you want to adjust just the TP value.
Here are both correction, to the second While:
Remove the OR comparision.
TP variable already is Zero, and having that OR inside the while does not make sense.
Change to this:
On the second While, change this:
to this:
And you are passing the SAME TP value to Order itself.
This has to be:
The rest seems fine.
PS: for SELL orders, invert the logic:
UPDATE: Why are you changing the StopLoss too? I can notice on the picture spreadsheet that SL is a complete mess.
You are changing it doing sequencia loops. Every time the while is run, it will subtract the BID value from the current StopLoss value.. on the next run, it will subtract again... and again..
This is wrong.. the SL Value will become negative at some point.
Dont change SL, if you want to adjust just the TP value.
Here are both correction, to the second While:
Hello and thank you
I edited the points you said like this
But still I could not get the result
Hello and thank you
I edited the points you said like this
But still I could not get the result
Please take a look carefully on my previous answer. You are still making a mistake that I pointed out.
Do not change the SL to random calculated values (explanation is detailed on my previous answer)
Please change:
to:
This is getting ridiculous. You keep just showing parts of your code but never how you are calling it or implementing it.
Let's just stop beating around the bush! Just attach your entire code file, so that we can properly compile it, test it and show you what you are doing wrong.
Please take a look carefully on my previous answer. You are still making a mistake that I pointed out.
Do not change the SL to random calculated values (explanation is detailed on my previous answer)
Please change:
to:
Hello dear Rrocchi,
I changed it according to your orders, but the profit limit still does not change
Like the previous photo I sent you, there was no change
Thank you for your follow-up and guidance, dear friend.
Here is my solution to the problem. It's easier for me to just write the program than to fix a program from a newbie!
This EA will accept manual entry of multiple Orders or the EA can Auto enter multiple Pending Orders at Fixed, but adjustable, distances apart, if selected in the settings.
Since no Order will close until the Highest Order TP has been reached, I have just programmed it to take the TP from the Highest Order and Modify the TP of all other
Orders to match; so they will all close when that TP is reached. While StopLoss can be Enabled or Disabled; it does need to have a "Break Even" and a "Trailing Stop"; in the evnt the TP
of the Highest Order is not reached. It has only be tested in Strategy Tester; as the Market was closed when I finished!
Charlie Bear!
Here is my solution to the problem. It's easier for me to just write the program than to fix a program from a newbie!
This EA will accept manual entry of multiple Orders or the EA can Auto enter multiple Pending Orders at Fixed, but adjustable, distances apart, if selected in the settings.
Since no Order will close until the Highest Order TP has been reached, I have just programmed it to take the TP from the Highest Order and Modify the TP of all other
Orders to match; so they will all close when that TP is reached. While StopLoss can be Enabled or Disabled; it does need to have a "Break Even" and a "Trailing Stop"; in the evnt the TP
of the Highest Order is not reached. It has only be tested in Strategy Tester; as the Market was closed when I finished!
Charlie Bear!