[ARCHIVE]Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Can't go anywhere without you - 5. - page 317
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
How can I simplify this expression?
is from the ADX algorithm by MetaQuotes. MetaQuotes themselves use this expression:
- how to simplify it?
Why doesn't the simplest option suit you?
Why is the simplest option not good enough for you?
I guess sometimes you have to look at a problem from a different angle. Right, thank you.
hoz, at I was wondering how to shorten the if even further.See: if we put a variable
we have cnt=cnt+step, where
But 1=cnt/cnt, a -cnt=cnt/(-1), the only difference is the denominator. Now recall that x^0=1, x^1=x, i.e. we can put our Boolean variable _if in the exponent, i.e.step=cnt/a*(cnt^_if); where
But ±a is supposedly 2*_if-1, i.e.
Or we simplify
Wow, you have simplified things. I don't understand your logic.
I figured we'd go down to if... :-)))
I also understood that I didn't understand anything. Not even those icons of incomprehensible... :)
Bars of one sign are going up, i.e. bullish.
How to make it so that when a trend parameter is passed to this function, which will be responsible for the transfer of the assumed main trend at the moment, the calculation is based on this parameter.
I.e., if trend == downward, the function in the loop was like now, and iftrend == upward, the Open[i] and Close[i] were swapped in the loop, so that the conditions were observed. In that case, the bar close price will be lower than the open price and the difference will be minus.
Or to simplify it further
Δ is the difference, i.e.Close[i] - Open[i], ^ is the power sign. const - constant in this expression, i.e.i_sizeOfSequentialCorrectionBar * pt, standard mathematical notation, I haven't invented anything. 2*bVar-1 is similar to±1, bVar here is any bool-variable. And expression 2*bVar-1 takes values not 0 and 1, but -1 and +1.≥ is MQL4 >=, also a standard mathematical notation.step is a step, i.e. in cnt++ step is 1, and in cnt=0 step is -cnt. What else was unclear from the notations?
How can I suggest - how to make MT4 delete free logs automatically (or not to create them at all)? I have to use some brokerage companies with 5 digits, these logs start growing in one day (by 1.6 gb), and place on vps is limited. Thanks in advance.
You can do it yourself:
Library1, library2.
==============
Although, the last (current) file is opened by the terminal. It is not easy to delete it. But you can delete the contents, which is written in the beginning.
Creation of logs is not disabled.
==============
1. Create a symlink (library1) to the logs folder in the files folder.
2. Delete all unnecessary files using MQL4 tools.
Open current file using MQL4. Edit it as you need.
4. Close the file.
5. You can delete the link. You do not have to. It will come in handy later.
==============
You can also create a script file (BAT) and run it in the Expert Advisor. The script is the same as above. Only without creating a link. Working with files, of course, using Windows tools.
How can I advise how to delete free logs automatically (or not to create them at all)?
Because on some DCs with 5 digits, these logs for a day grow to appalling size (by 1.6 gb), and space on the vps is limited. Thanks in advance.
logs what?
What is the difference between this and the EA errors?
Hi! I need help with refining my primitive robot. To start with, I'll explain my simple strategy to make it clearer where help is needed and for what purpose.
The essence of TS:
1. If the open price is lower than the MA and the close price is higher, we buy.
2. If the opening price is higher than the MA and the closing price is lower, we should sell.
If the price has moved by X% from the most favourable price, then we close the order. This is similar to a trailing stop but instead of pips X% of the opening distance of the order and the best price. As it is shown on the picture:
AB - distance from order opening to the most favourable price; BC=X% of AB; C - order closing.
Items 1 and 2 I have written in the program:
Generally, I need help with writing a function to close orders for my TS (point 3) and adapting existing code to the function.
P.S. And I know the TS is not good.