View Full Version : Changing base currency
08-17-2008, 05:24 AM
I am aware of the problem with the base currency conversion and am curious to know if a fix is planned for this, in the meantime could you explain the process of changing the base currency value on any particular pair for the strategy analyzer...
08-17-2008, 05:27 AM
Sorry I don't follow.
08-17-2008, 06:02 AM
"Special Circumstances with GAIN Forex
During a backtest, order quantity is an absolute value which is in most cases different than in a real-time brokerage account. As an example, 1 traded FX lot at a live brokerage account might be the equivalent to 100,000 of notional value (check with your broker) however, in backtest a value of 1 is a literal value of 1 and not 100,000. Thus, if you want to trade 100,000 in a backtest you need to put in a value of 100,000. Just remember that if you convert your strategy from backtest to live you will need to amend the order quantities appropriately."
"It is important to understand how order quantities behave when running a real-time FX strategy in a live brokerage account. This is relevant for:
Currency and point based performance calculations
Actual order size being submitted to your live brokerage account
Running FX NinjaSript Strategies in the Strategy Analyzer, Simulated Data Feed Connection or Market Replay
Running an FX strategy in the Strategy Analyzer (http://www.ninjatrader-support.com/vb/Overview37.html) for a historical backtest, in real-time connected to either the Simulated Data Feed (http://www.ninjatrader-support.com/vb/SimulatedDataFeed.html) or Market Replay (http://www.ninjatrader-support.com/vb/Overview14.html) order quantities will always represent the total units of the base currency being traded. A lot size of one equals a base currency unit of one and DOES NOT equal a typical "standard" lot size of 100,000. Therefore, if you want to trade a standard lot you would use an order quantity of 100,000.
Running FX NinjaScript Strategies on a Live Brokerage Connection
Running an FX strategy on a live brokerage connection either in a live funded account or a simulation (Sim101) account order quantities will reflect the lot size convention that your brokerage trades in. For example, if your brokerage has a lot size of 1 that equals 100,000 units of the base currency (a "standard" lot) then use a value of 1 to trade 100,000 base units.
Based on the above information, if you are backtesting in the Strategy Analyzer using order quantities of 100,000 and you now wish to trade live in your brokerage account where 1 lot is equal to 100,000 MAKE SURE that you adjust your strategy's order quantity from 100,000 to 1 to ensure you are trading the correct quantity."
08-17-2008, 08:45 AM
There is no fix planned since there is nothing broken. This is a limitation based on the nature of having to support multiple FX brokers. I have seen others include a true/false user defined input to switch between live and backtest which changes the order quantity used internally etc...
08-17-2008, 11:24 AM
OK understood, could you explain how to change the base currency value for the strategy analyzer...
08-17-2008, 06:43 PM
Can you clarify what you mean by base currency value?
08-18-2008, 07:15 AM
Changing the order quantity in the strategy analyzer to an absolute value as quoted in my previous post, the max value is 9999 which is almost equivilant to 1 mini lot on the backtest strategy results, how would you change this to say...4 mini lots..
08-18-2008, 07:27 AM
Why do you think 9999 is the max order quantity?
08-19-2008, 01:19 PM
In the edit strategy - user defined inputs, the max allowable input is 9999. Is there a better way to go about defining order quantity for backtesting a forex pair?
08-19-2008, 01:22 PM
Thanks for clarification. We'll change the max value for next update.
You can set the qty on the strategies dialog as you start the strategy: Set order qty->by default qty and then Default qty-><your qty, e.g. 10000>
08-19-2008, 03:44 PM
Thanks for the help, i would not have figured that one out on my own, now my next problem...
How would you input multiple profit targets in the strategy analyzer, for instance,... say I wanted to enter 4 minis with a 40 pip SL and sell 2 with a profit target 20 pips from my entry and the remaining 2 at 40 pips from my entry? averaging out of the position.
08-19-2008, 03:56 PM
Unfortunately, this is not supported as you can see at the link below.
ATM strategies operate in real-time only and not with historical data, thus backtesting is not possible.