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

Sim101, Replay101, backtest account balance questions

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

    Sim101, Replay101, backtest account balance questions

    Hello NT Team,

    Help me please, because I prepared a major code for the positioning of the Forex entry size, but I got stuck and mixed up.
    1. Am I right, that AccountSize property can be used exclusively for Strategy Analyzer (Back101 account) (it has nointerest anywhere else)?
    2. How does the Sim101 és Replay101 account handling work, because simply I don't understand. Examples:
      • a) If Initial Margin is set to theintrument, then at entry it is seen in the grid, but it does not substracted from the cash value. (I do not undarstand)
      • b) so far to the previous, is the set of the Initial Margin of the Instrument used anywhere else? Does it have any importance aside from the a) point?
      • c) because it doesn't differentiate more money accounts, but the balance (Sim and Replay)is accessible as an unknown account, so my question would be, if I run simulation strategy at two forex pair at the same time, then how do the profit of the two transactions (in two different currency) enter a sum to one unknown account and in what kind of currency?
    Code:
    NinjaTrader.Cbi.Account CurrentAccount = Account;
    CurrentAccount.GetAccountItem(AccountItemType.CashValue, Currency.Unknown).Value;
      • d) To the previous one: possibly in case of Forex the simulation account is suited only for the testing of 1 forex pair?
      • e) To the previous one: if d) point is true, then would the solution be to set high the Account Initial Cash at the testing of Sim and Reply, thendo not care about it, but write separately the handling of my own money accounts and initial margin with my own variable?
      • f) Do the Cash Values have any other meaning in simulation mode then to interfere the trade with more money like on the account? (because if it has no other meaning, then I could get round it with the solution written in point e).
    I wrote a general solution for Forex, which according to my expectationcould be used either in live or in any test solutions or with entry position sizing handling different currencies, in a given currency the PnL, etc, etc, etc. I almost finished it, but to use the Market Reply and watch the behaviour of cash value (and because I think that we are talking about Forex and about different currencies) I stuck so much.

    What do I understand correctly and what do I misunderstand?
    Thanks in advance,

    #2
    Hi tamas,

    1. With AccountSize you can set a starting account balance, also from NinjaScript - http://www.ninjatrader-support.com/H...countSize.html For example also when starting your strategy live in the chart or strategies tab.

    2. Not sure I follow, can you please clarify?

    3. The initial margin is used to determine how many lots you can buy with your current account size.

    4. The Sim101 account is used for all instruments and is handled in US $.

    5. No, you can test any Forex Pair and combinations on the Sim101 account.

    6. See 5

    7. Not sure I follow, what do you mean 'by any other meaning'?

    Generally, accessing the real account values in NinjaScript is unfortunately not supported at this time, but this is on our 'future consideration' list.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Thank you, but i ask

      1 and 2) OK, example: If i set the backtest or the strategy "by strategy" and i set quantity in code EnterLong(int quantity) for the entry then does NT use Accountsize and initial Margin for anything else?

      4) Sorry, but HOW? Two strategies are running. EURGBP and EURCHF. How will it be creditid in USD in SIM account?

      Originally posted by NinjaTrader_Bertrand View Post
      Generally, accessing the real account values in NinjaScript is unfortunately not supported at this time, but this is on our 'future consideration' list.
      I know, i know, i read in lot of threads in this forum. My biggest problem as i see after few weeks testing, that NT is good framework, and NinjaScript is figured out good as well, but it is not really suitable for fully autotrading - yet.

      But it is not a problem, if i can code the missing parts of my requests and then buy it. Thats why i would like understand how does it work now, and i am not interested in the not supported features.

      Comment


        #4
        1, 2. Not used.
        4. Bring up a chart and make some manual trades and you will be able to see. It will just take exit price - entry price multiplied by your quantity.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_Josh View Post
          1, 2. Not used.
          4. ...It will just take exit price - entry price multiplied by your quantity.
          OK.

          Josh, Bertand thank you

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by dcriador, Today, 12:06 PM
          0 responses
          9 views
          0 likes
          Last Post dcriador  
          Started by dcriador, Today, 12:04 PM
          0 responses
          5 views
          0 likes
          Last Post dcriador  
          Started by cutzpr, Today, 08:54 AM
          0 responses
          11 views
          0 likes
          Last Post cutzpr
          by cutzpr
           
          Started by benmarkal, Today, 08:44 AM
          0 responses
          17 views
          0 likes
          Last Post benmarkal  
          Started by Tin34, Today, 03:30 AM
          2 responses
          29 views
          0 likes
          Last Post Tin34
          by Tin34
           
          Working...
          X