Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 886
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
Check in more often. There will be fewer questions. There will be better knowledge.
Good afternoon. Need to somehow close a position at the end of the day (purely Expert Advisor; daily bars). The modelling is either by openings or by ticks. I.e. we either settle for openings or tumble over our heads trying to analyze previous days on some 15 min timeframe and catch the beginning and end of the current one. Are there any solutions to this problem? I see several virtual-hypothetical options:
1) Hacking-closing a position at any price and at any time. Suppose unfair, but we could simply close the position at the required price without perversion.
2) To simulate the opening and closing within one bar. I.e. first a tick open, then a tick close.
3) Setting an order that automatically closes at a certain time (i.e. at the end of the day).
Any help would be appreciated. Thank you.
A bug?
2015.04.13 20:51:10.710 indi AUDJPY,H1: Requested indicator subframe: -1
A bug?
2015.04.13 20:51:10.710 indi AUDJPY,H1: Requested indicator subframe: -1
No, not a bug.
Return value.
Subwindow number in case of success. Zero indicates the main chart window. In case of failure it returns -1.
No, not a bug.
What is the failure if the function passes the ID of the current chart, on which the indicator is running, and the name of the current indicator that is running on the current chart?
If I understand you correctly and you need the subwindow number in which your attached indicator test code works, then, based on the description of the function, it's better to apply its second version.
Test code (I have added some lines to yours):
The help for ChartWindowFind() function has a good example still on this subject (in terms of comments there as well):
If I understand you correctly and you need the subwindow number in which your attached indicator test code works, then, based on the description of the function, it's better to apply its second version.
Test code (I have added some lines to yours):
The ChartWindowFind() function's help has a good example still on this subject (in terms of comments there as well):
Good evening!
I can't figure it out: In the start function, the compiler requires "return" - the function must return a value".
What value must return in this case?
int start()
{
if (Orders!=0||Ord > 0)
{
CritCloseBuy();
CritCloseSell();
}
else
{
CritOpen();
}
return;
}
Could this be the reason why OrderClose() doesn't see an open position?
Good evening!
I can't figure it out: In the start function, the compiler requires "return" - the function must return a value".
What value must return in this case?
int start()
Can this be the reason why OrderClose() does not see an open position?
do void start() and there will be no error