Dukascopy
 
 
Wiki JStore Search Login

Display mode of traded amount
 Post subject: Display mode of traded amount Post rating: 0   New post Posted: Mon 25 Jun, 2012, 16:00 

User rating: 0
Joined: Mon 25 Jun, 2012, 15:55
Posts: 13
Hi Dukascopy-Support,


when I try to get the traded amount, in backtest I get the value of 1000, while when I start the Strategy,
a value of 0.001 is displayed. How can I change the display mode of that value from 0.001 to 1000?

Here is a simply strategy which shows that issue:


package jforex;

import java.util.*;

import com.dukascopy.api.*;

public class Strategy implements IStrategy {
    private IEngine engine;
    private IConsole console;
    private IHistory history;
    private IContext context;
    private IIndicators indicators;
    private IUserInterface userInterface;
    private Instrument instrument ;
    private double Amount;
    public void onStart(IContext context) throws JFException {
        this.engine = context.getEngine();
        this.console = context.getConsole();
        this.history = context.getHistory();
        this.context = context;
        this.indicators = context.getIndicators();
        this.userInterface = context.getUserInterface();
   
    IOrder order =engine.submitOrder("BUYORDER", instrument.EURUSD   , IEngine.OrderCommand.BUY , 0.001);
   
    }

    public void onAccount(IAccount account) throws JFException {}

    public void onMessage(IMessage message) throws JFException {
       
       
   
    double Amount = message.getOrder().getOriginalAmount();
   
    console.getOut().println("Amount  =" + Amount);
    return;
    }

    public void onStop() throws JFException {
    engine.getOrder("BUYORDER").close();
    }

    public void onTick(Instrument instrument, ITick tick) throws JFException {
    }
   
    public void onBar(Instrument instrument, Period period, IBar askBar, IBar bidBar) throws JFException {
    }
}







Thank you

Jimmy Knoppers


 
 Post subject: Re: Display mode of traded amount Post rating: 0   New post Posted: Mon 25 Jun, 2012, 17:50 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
See:
https://www.dukascopy.com/wiki/#Order_Amounts


 
 Post subject: Re: Display mode of traded amount Post rating: 0   New post Posted: Mon 25 Jun, 2012, 18:39 

User rating: 0
Joined: Mon 25 Jun, 2012, 15:55
Posts: 13
Thank you for the answer, but it didn't help.

when I try to get the traded amount, in backtest I get the value of 1000, but when I start the Strategy in Live-Account
a value of 0.001 is displayed. Why? How can JForex provide the same value (either in Backtest or Live-Account)?


Thank you

Jimmy Knoppers


 

Jump to:  

  © 1998-2025 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