| / | Forum |
|
mastermedea
2008.01.25 13:57
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, |
|
phy
2008.01.25 19:35
Parameters:
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. 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 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 index: Usually same meaning as bar number. Indicator Index usually means which indicator buffer (0-7) |
|
azizan8
2008.08.10 14:07
mastermedea wrote >>
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++)
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: for (cnt = 0; cnt < OrdersTotal(); cnt++)//open positions Again, standardization is most important. Otherwise, you will get error 145 "order is too close to market" Regards, azizan8 |
|
phy
2008.08.10 20:32
"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. |