[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 648

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
You can do this.....
This variant will not work correctly, because NewBar gives true only on the first tick of the bar. To work correctly, we should place the FunNewBar(); if(!NewBar) return; line inside the condition of trade opening, and after successful opening.
Although it will not be quite correct. In short, r772ra's variant should be corrected, and better to use a fundamentally different approach, for example, to watch the time of opening of the last order in the history and compare it with the time of the current bar - it will be much more reliable
It goes something like this.
Thank you! I'll give it a try...
tweaked the code
Yay!!! I made it through
{
static datetime New_Time=0;
New_Bar=false;
if(New_Time!=Time[0])
{
New_Time=Time[0];
New_Bar=true;
}
}
Thank you so much!!! Will it work if I put the signal on the minus first bar from the open?