Dukascopy
 
 
Wiki JStore Search Login

Close on tick
 Post subject: Close on tick Post rating: 0   New post Posted: Sun 12 Feb, 2012, 14:13 

User rating: -
If i close the order in tick
 public void onTick(Instrument instrument, ITick tick) throws JFException {
       if (!instrument.equals(myInstrument)) {
            return;   
        }
        for (IOrder orderInMarket : engine.getOrders()) {
                if ((orderInMarket.getInstrument() == myInstrument)) {
                      if (orderInMarket.getProfitLossInPips()<stopLoss*-1) orderInMarket.close();
                      if (orderInMarket.getProfitLossInPips()>profitTarget) orderInMarket.close();
                    }
                }
}


But the submitting the order is depend from 15minutes bar.

How i can run Historical test?
Tick or 15 minutes


 

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