[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 379
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
DanLett:
Call the procedure like this, for example:
Question: How do I get the "shift" value? (when I call the indicator with a shift, it uses the same values as without it, i.e.iCustom(NULL, 0, "name",pam1,0,1)= iCustom(NULL, 0, "name",pam1,0,100), but if I call the indicator 100 bars ago, it will have a different value from iCustom(NULL, 0, "name",pam1,0,100). The indicator is simple, it uses 5 previous Close values and takes their average.
double iCustom( string symbol, int timeframe, string name, ..., int mode, int shift)
shift is the number of the bar from which you take the indicator data, zero bar is the current bar which hasn't been closed yet. The parameter is named shift because it shows the offset of the received data from the zero bar in bars.
I use Terminal() function from the tutorial when closing positions, provided that Mas_Ord_New[0][0]!=0. But here we have another task: we need to make a flag prohibiting to trade on the current signal, if one order has already been opened on it. I am trying to use flags but I have made a mistake.
I think it would be better to put an appropriate magic number in the order and check if such a position is in the list. If there is = flag-true, no = flag-false. Then on condition of opening a position on your signal insert a flag, e.g:
I think it is better to put the appropriate magic number in the order and check if that position is on the list. If there is a flag-true, no flag-false. Then if a position is opened by your signal, insert a flag, e.g:
Can you tell me why the optimiser can count but not produce results? There are no errors in the log. The genetic algorithm is disabled. The interval of optimization is 5 days, the mode is all ticks, the period is any m1, m5, m15, m30. The results appear only beginning with the period H1.
On periods shorter than H1 the algorithm fails.
On periods shorter than H1, the plummets.
Can you tell me why the optimiser can count but not produce results? There are no errors in the log. The genetic algorithm is disabled. The interval of optimization is 5 days, the mode is all ticks, the period is any m1, m5, m15, m30. And the results appear only starting from the H1 period.
If the earnings are negative with this combination of parameters, the results are not shown. Generally, 5 days is a very short period, set at least a month.