I'm using MetaEditor (v. 3.83). I've just begun the process of trying to teach myself how to make use of this tool.
I do have some background in coding, but that was a few majors and many years ago. So there are just a few cobwebs floating around that are not happy about being disturbed.
My first attempt is just a simple test run of opening a long position if the previous bar's close was up and a short if the previous bar was lower.
The basic structure was simple enough to set up, but then I noticed a problem I'm not sure how to approach.
If I hit either my Stop Loss or make Take Profit numbers before the close of the current bar, and close the position.....on the next tick, a new position is opened as it is still true that the prev bar hasn't changed (meaning that if the first buy was a long, then I open a second long on the same bar).
Basically, how do I code to tell ME not to open a second position on the same bar?
Thanks,
Jonathan
I do have some background in coding, but that was a few majors and many years ago. So there are just a few cobwebs floating around that are not happy about being disturbed.
My first attempt is just a simple test run of opening a long position if the previous bar's close was up and a short if the previous bar was lower.
The basic structure was simple enough to set up, but then I noticed a problem I'm not sure how to approach.
If I hit either my Stop Loss or make Take Profit numbers before the close of the current bar, and close the position.....on the next tick, a new position is opened as it is still true that the prev bar hasn't changed (meaning that if the first buy was a long, then I open a second long on the same bar).
Basically, how do I code to tell ME not to open a second position on the same bar?
Thanks,
Jonathan