Hi Supporter,
I run a Strategy on the Remote Run as a Demo account.
The code should be open only one order at one time:
============================================
public void onTick(Instrument instrument, ITick tick) throws JFException {
if (currentInstrument != Instrument.EURUSD || period != Period.ONE_HOUR) return;
Ask = tick.getAsk();
Bid = tick.getBid();
TickTime = tick.getTime();
if (!Initialized) {
InitSystem(); // Start our system
}
else if (Running) { // Are we in a trade at the moment?
if (CheckExit()) { // Yes - Last trade complete?
Initialized = false; // Yes - Indicate we need to reinitialise
InitSystem(); // and start all over again!
}
}
else {
if (CheckEntry(Lots)) { // Entered a trade?
Running = true; // Yes - Indicate that we're in a trade
}
}
}
====================================================
But some time the code open two orders as attached img.
Could you kindly tell me what's wrong with this code?
Best thanks & regards
Moose
Attachment:
DuplicateOpenOrders.jpg [41.29 KiB]
Downloaded 382 times