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
Hy phy, thanks for your answer. Could you please also explain the meaning of "shift" parameter in the indicators and "ma_shift" in iMA specifically?
Shift = Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago). From my so-so English and poor uderstanding of coding, terms like "shift", "buffer", "index" has something to do with the calculation speeds or memory allocated to the calculation of indicators etc. Then what sense does it make from the trading perspective to set "shift" other than 0?
ma_shift = Indicators line offset relate to the chart by timeframe. Say ma_shit = 5, is it to shift the MA line on the chart backward by 5 bars? Then again what is its trading purpose because I assume that calculations of indicators and execution of EA have nothing to do with what appears (line) on the chart.
All the above concerns derive from my not understanding some particular terms in English used in this coding context, e.g "offset", "index", "buffer" etc.
Thank you very much and best regards,
ma_shift:
the displayed indicator is offset (moved, shifted) to the past or future.
Put two MA on a chart (manually). Use the same parameters. You will see one line on the chart.
Now change the shift of one, and there will be two lines, identical shape, but one is moved (shifted or offset) to the future or past.
Why? Some people like it... Try shift of 1 on one MA, and make one Red and one Green. Now one color is on top in uptrend, the
other color on top in downtrend.
shift:
The bar at which you calculate the value. 0 = calculate indicator value for current bar. 1 = calculate for next newest bar, and so on. Usually
used in a loop, where you put the loop counter in the shift parameter, to calculate the indicato value for many bars.
index:
Usually same meaning as bar number.
Indicator Index usually means which indicator buffer (0-7)
Hi phy,
Could you please explain what does the error 145 "order is too close to market" mean?
Thank you very much,
cheers
Dear Mastermedea,
I faced the same problem with you. However, it was solved. I will explained to you based on my knowledge. See the following codes:-
for (cnt = 0; cnt < OrdersTotal()-1; cnt++)
The 1st one is for opening order and Trailing whereas the 2nd ones for closing order. The most important things that coder need to know is the standardization of code in your EA. It is possible to use the following code as well:
Again, standardization is most important. Otherwise, you will get error 145 "order is too close to market"
Regards,
azizan8
"Could you please explain what does the error 145 "order is too close to market" mean?"
Check MarketInfo(Symbol(), MODE_FREEZELEVEL)
Just another tool the Dealer can use to defeat your strategies.