Fixed
It might not have anything to do with this issue . . . but using Bars is a bad idea . . . didn't I say that before ?
First tick through your code . . . .
if (EachTickMode && Bars != BarCount) TickCheck = False;
. . . BarCount has been declared but has not been given a value . . . so this makes no sense.
All this kind of stuff will fail when you have maxed out the number of bars on your chart . . .
(Bars != BarCount)
In your other post you said you want to open an order at the start of a new bar and close it at the end of the bar, "trade one bar" . . . . to stop the code opening and then immediately closing why don't you simply check when the order was opened and don't allow it to close if the time is less than 1 bar ?
Attach large amounts- You can call newBar ONLY once per tick.
- Delete ALL references to BarCount
- You MUST count down when closing multiple orders or in the presence or multiple orders from multiple charts.
You need to learn to code . . not how to use templates . . . it takes a lot of effort, but what you are trying to achieve is not a trivial thing.
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