Dukascopy
 
 
Wiki JStore Search Login

Duplicate Orders Opened
 Post subject: Duplicate Orders Opened Post rating: 0   New post Posted: Wed 21 Mar, 2012, 00:42 

User rating: 1
Joined: Fri 09 Mar, 2012, 15:43
Posts: 2
Location: CanadaCanada
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


 

Jump to:  

cron
  © 1998-2024 Dukascopy® Bank SA
On-line Currency forex trading with Swiss Forex Broker - ECN Forex Brokerage,
Managed Forex Accounts, introducing forex brokers, Currency Forex Data Feed and News
Currency Forex Trading Platform provided on-line by Dukascopy.com