Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Realistic Test

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

    Realistic Test

    I wrote a strategy. For realic test I have to use two series (ask&bid) or is there more easy way in NT? Any for realistic test any other suggestion?(Any sample, usefull link or directly idea)

    Also my strategy buy sell orders, order management etc. is logic related bar close so i use CalculateOnBarClose. If i convert tick by tick strategy for order management can i take any advantage?(Entries again will create when bar close).

    Also can i access bar number which my stopentry order signal bar?

    Thanks.
    Last edited by aytacasan; 08-19-2011, 04:25 AM.

    #2
    aytacasan, executing in backtesting to the actual bid / ask series would be a fine way to approximate executions. Forward testing in Market Replay would be also recommended before going live.



    For realtime operation / Market Replay you could run parts of the logic on bar close and others intrabar if desired - http://www.ninjatrader.com/support/f...ad.php?t=19387

    Comment


      #3
      Hi Bertrand,

      Thanks for your response. For clerify, suppose i'm running my strategy calculateonbarclose mode, if i give stopbuy order currentbar.high + 0.0005 pip on close. And next bar appear and ticks comming and penetrate my entry. This order is instantly filled or waiting bar close because my strategy option is this. Of course this question is not related real time. Historical test & market replay test related.

      And can i access bar number which my stop entry order signal bar? I mean, suppose i give an stopbuy order 34. bar and its filled 40.bar. I need 34.bar EMA value. For this i have to hold one variable or NT can say this order created 34.bar.

      And for test Bid/Ask is same multiple instrument work? I mean in initialize i have to add same instrument same time frame bid and ask data series and then when i buy use ask when i sold bid etc.?

      Best Regards.

      Comment


        #4
        aytacasan, the CalculateOnBarClose is set 'true' in backtesting per default, as there no intrabar information available then, this would only be relevant for Market Replay testing or live trading.

        Yes, you can save the CurrentBar number for example to a variable once you place the order to have it for your later reference.

        Correct, you would add then the bid and ask series of the same instrument to be able to execute orders to those.

        Comment


          #5
          Thanks Bertrand for quick response, additionally i seacrh abount money management for historical and market replay test but i can't find any result. Could youplease tell me where can i find. I want to calculate order size before create order wich (Account Size * 0.01 / pip value)/stop level or something like this.

          If there is a sample this will so good.

          Comment


            #6
            You would need to run custom calculations to achieve this, strategy though can per default run by AccountSize - http://www.ninjatrader.com/support/h...ccountsize.htm

            Comment


              #7
              Hello Bertrand,

              I'm confused about manually add ask&bid data series to strategy. I see Strategy has GetCurrentBid & Get CurrentAsk functions. Also if i add manually ask and bid series, like strategies runing for to series. Is there a way to say strategy when you buy use this ask series and sell use this bid series.

              Comment


                #8
                aytacasan, yes basically you would add the needed series data in the Initialize(), i.e.:

                Add("MSFT", PeriodType.Minute, 5, MarketDataType.Ask)

                and then submit orders to this BIP, if the ask series above is the first added series you would submit then to the BIP 1:

                EnterLong(1, 1000, "Long MSFT")

                Comment


                  #9
                  Thanks for quick response,

                  Actually, i put my strategy on 60 minute last price chart. In strategy initialize i add two series like this:
                  Add(Instrument.FullName, BarsPeriod.Id, BarsPeriod.Value, MarketDataType.Bid);
                  Add(Instrument.FullName, BarsPeriod.Id, BarsPeriod.Value, MarketDataType.Ask);

                  than i use this series only for entry rules etc. and take right price for entry and exit.
                  When i enter an order, i give BIP parameter always 0 (mean chart last price series)

                  Are you want to warn me about this scenario or have to work like this?

                  Also please tell me How it works Strategy.GetCurrentBid & Strategy.GetCurrentAsk functions?

                  Best Regards.

                  Comment


                    #10
                    aytacasan, I'm sorry not following what you attempt saying here - why would you submit to BIP 0 then in backtesting if you like to execute on either bid / ask?

                    GetCurrentBid and GetCurrentAsk will not work for backtesting and order submission.

                    Comment


                      #11
                      Actually i want to show buy and sell orders on the same chart series. Ok i'll try to sell bid series and buy in ask series.

                      Thanks.

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                      0 responses
                      672 views
                      0 likes
                      Last Post Geovanny Suaza  
                      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                      0 responses
                      379 views
                      1 like
                      Last Post Geovanny Suaza  
                      Started by Mindset, 02-09-2026, 11:44 AM
                      0 responses
                      111 views
                      0 likes
                      Last Post Mindset
                      by Mindset
                       
                      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                      0 responses
                      577 views
                      1 like
                      Last Post Geovanny Suaza  
                      Started by RFrosty, 01-28-2026, 06:49 PM
                      0 responses
                      582 views
                      1 like
                      Last Post RFrosty
                      by RFrosty
                       
                      Working...
                      X