[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 490
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
If a 0.01 lot = 1 cent, then for a 0.1 lot position with a 200 pips stop loss = 20 USD.
Please help to make this function vice versa:
That is, if the price goes to a loss from an open order by the number of pips LevelProfit (you can call it LevelLoss), you have to move TakeProfit to zero or to a loss by 1 pip 2, etc., depending on what you put in the LevelWLoss parameter, so that if the price even turns around, there would be no more profit. Or maybe you have a ready one?
Thank you in advance))
Good afternoon! You know, just cut the code from the EA's init section, (I was debugging it for the weekend - no ticks!), moved it to start. Removed outer fora loop. I compiled it.
It's coded-- 'continue' - 'break' or 'continue' used within some cycle only C:\Alpari\experts\Outputs.mq4 (69, 20)
What is it about? Well, in loop continuo, in loop, so what? I don't speak much English. If I can understand some words, I can't make sense of them!
Good afternoon! You know, just cut the code from the EA's init section, (I was debugging it for the weekend - no ticks!), moved it to start. Removed outer fora loop. Compiled.
Came up with-- 'continue' - 'break' or 'continue' used within some cycle only C:\Alpari\experts\Outputs.mq4 (69, 20)
What's that about? Well, in the loop, in the loop, so what? I'm not very good at English. If I understand some words, I can't make sense of them all!
Please help to make this function vice versa:
That is, if the price goes to a loss from an open order by the number of pips LevelProfit (you can call it LevelLoss), you have to move TakeProfit to zero or to a loss by 1 pip 2, etc., depending on what you put in the LevelWLoss parameter, so that if the price even turns around, there would be no more profit. Or maybe you have a ready one?
Thank you in advance))
The function may be as follows:
Don't forget to check MODE_STOPLEVEL and MODE_FREEZELEVEL constraints when modifying a STOP.
Thank you!!! Let's have a look...
How not? And if (BUY == 0)- isn't this a loop? Strangely, I only removed the outer loop, which surrounded the whole program in parentheses. It was needed for debugging, so I took it out.
If it's not there, let it pass if (strela1 < strela2), the program's logic won't be broken.
Thank you!!! Let's have a look...
How not? And if (BUY == 0)- isn't this a loop? Strange, I only removed the outer loop that was bracketing the entire program at the start.
No. Not a loop. You took out exactly what should have been left. Read the whole tutorial! Especially here: "An example of using a compound operator in a conditional operator. The conditional if(expression) operator comes first, followed by the compound operator. The compound operator contains a list of executable operators."
TarasBY, thanks for the explanations and the function!
I'm taking the function to my collection, but I don't understand something:
Parameter fi_LevelBU has minus value - it shifts take profit, while if it has plus value it shows profit or vice versa?
And second: is it better to check for constraints within the function itself or outside the function?