Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

USD Base and Quote Forex Pairs within One Strategy

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    USD Base and Quote Forex Pairs within One Strategy

    Hi,

    I'm looking at creating a strategy which trades several pairs, but more importantly with USD as the base (e.g. USDJPY or USDxxx) and also as the quote currency (e.g. EURUSD or xxxUSD) within the same strategy.

    The issue is that when the strategy trades USDJPY, Strategy Analyzer as well as internal metrics such as SystemPerformance.AllTrades.TradesPerformance.Curr ency.CumProfit gives me the currency profit in JPY rather than USD, which is similar to what would happen in reality.

    However, is there any way to force the strategy to provide this in USD instead?

    Otherwise I can see there being issues if the system does not recognize the P&L currency because if I were to add EURUSD to the same strategy, the P&L contributions from the JPY trades will crowd out the EUR trades, and also, the backtest wouldn't be accurate as 1 JPY in P&L (from USDJPY trades) will be seen as the same as 1 USD (from EURUSD trades).

    I know that switching to % may resolve this issue as that will still be accurate. However, one important part of the strategy is that it trades dynamic sizes. The way Strategy Analyzer works is that a 5% profit on a 1/10th position is taken to have the same effect on cumulative net profit as a 5% profit on a full size position. Therefore, the way I usually handle this is by working in currency and then tracking metrics internally.

    Do you have any advice on what I could do to backtest strategies with pairs that have USD as both the base and quote currency?

    Thanks in advance!

    #2
    Hello wuileng,

    Thank you for your post.

    NinjaTrader isn't really designed to handle this kind of situation gracefully, unfortunately.

    You'd really need to design your own PnL tracking for something like this. I do have a sample script that shows how to get the conversion rate to USD for non USD quoted pairs that may be helpful that I'm attaching below. You could certainly print PnL information to the Output window, even during a backtest, and use that to make your own calculations.

    Please let us know if we may be of further assistance to you.

    Attached Files
    Kate W.NinjaTrader Customer Service

    Comment


      #3
      Noted with thanks, any chance this could be added to a feature request list for future versions if one exists?

      Comment


        #4
        Hello wuileng,

        Thank you for your reply.

        I have created a feature request on your behalf to have better handling for PnL when using multiple forex data series. This request is being tracked under the number SFT-5125.

        As with all feature requests, interest is tracked before implementation is considered, so we cannot offer an ETA or promise of fulfillment. If implemented, it will be noted in the Release Notes page of the Help Guide.

        Release Notes — https://ninjatrader.com/support/help...ease_notes.htm

        Please let us know if we may be of further assistance to you.
        Kate W.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by warreng86, 11-10-2020, 02:04 PM
        7 responses
        1,360 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by Perr0Grande, Today, 08:16 PM
        0 responses
        5 views
        0 likes
        Last Post Perr0Grande  
        Started by elderan, Today, 08:03 PM
        0 responses
        9 views
        0 likes
        Last Post elderan
        by elderan
         
        Started by algospoke, Today, 06:40 PM
        0 responses
        10 views
        0 likes
        Last Post algospoke  
        Started by maybeimnotrader, Today, 05:46 PM
        0 responses
        14 views
        0 likes
        Last Post maybeimnotrader  
        Working...
        X