[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 606
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
Show the function itself.
If it is void ClosePartPosBySelect(double Part), change to
void ClosePartPosBySelect()
Kim's ClosePosBySelect() function is changed so that it requires a passed parameter of the double type, which is the Part variable
two ways
1. In the function where the value is changed, add an ampersand,
e.g. void function( double& Part ){}
then, when a value inside the function is changed, the new value will return to the place of call
2. remove the variable from the parameter list of the function, since the variable is defined globally, its value can be changed in any place of the code without passing it as a parameter...
The first variant is better, since there can be more than one globally declared variable (and inside one function)...
I have glanced through the post, in fact, the answer has already been given...
Hello Dear Professionals.
I would really like to write an EA which would open two Sell and Buy orders at the same time.
Then after a certain amount of points (parameter lim), the losing order would be closed,
and a profitable one will be closed when the price has fallen below the maximum price since the order was opened
(a kind of virtual trailing stop).
In agony I have created this, but it does not work... does not work
Please suggest something
How do you pass a parameter to this function then?
This is the whole of 2009... Only Momentum readings are used for entry:
On TF H1 we look for the moment of Momentum movement break, and on TF M5 we find the exact moment to enter the market. When opening a position, we check the time of the previous position opening, so as not to open the entire deposit at the time of the entry signal...
The time of entering the market is confirmed by Demarker's position in overbought/oversold zones on TF M5 and M15...
... By the way, without locking was also a positive result.
... Even the fact that I negligently ran the test only with Demarker, still gave interesting results:
![Only DeMarker](https://c.mql5.com/mql4/forum/2010/06/riudemark_small.gif)
It's something like this somewhere:
I wonder, if the result is similar, then why use momentum, which is good (as they say) for showing the moment of trend exhaustion (end)? When momentum breaks, the price kept going up and positions were opened at each new momentum break... So it was the early entries that I decided to lock...
What do you think about it?
you can't use zero bar in the tester, for the simple reason that despite the fact that it's only being formed (tester ticks) the tester has complete information about the prices of this bar, because it (the bar) is a fait accompli and the tester looks into the future taking data from the quotes history, not what it generates with ticks... shift one bar to the left and consider Momentums for 1,2,3 instead of 0,1,2 and demo 1 instead of 0...
It also makes sense to use only current m5 and multiply period where older prices are used. 14 * PERIOD_H1 / Period() and 14 * PERIOD_M15 / Period()
you can't use zero bar in the tester, for the simple reason that despite the fact that it's only being formed (tester ticks) the tester has complete information about the prices of this bar, because it (the bar) is a fait accompli and the tester looks into the future taking data from the quotes history, not what it generates with ticks... shift one bar to the left and consider Momentums for 1,2,3 instead of 0,1,2 and demo 1 instead of 0...
It also makes sense to use only current m5 and multiply period where older prices are used. 14 * PERIOD_H1 / Period() and 14 * PERIOD_M15 / Period()
I've already racked my brains :) - here's the problem:
EA works in semi-automatic mode - its inputs are my outputs from positions, but I can not figure out - how to make the EA to make only one trade before my command for the next one, ie I just do not have a start/start button on the chart :) . My init() section is busy, and I can't disable my EA - its calculations are needed for correct trawling
well, if the result (dynamics) is not very different from that obtained using a zero bar, there may be no peeking, but it is better to safeguard against illusions...
How is it possible to solve such problems?
Maybe there is some way to reduce such slippage? Your thoughts?