• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

stochastic

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

    stochastic

    Hi,

    I am running a strategy where I want to exit trades at market once the stochastic goes above 40 for longs and below 60 for shorts.

    It would appear on ninja that it is exiting on the close of the bar not at the point the price action moves the stochastic to the necessary level,

    Could anyone shed some light on this issue?

    Thanks in advance,


    Dan

    #2
    Hello dannypark100,

    Thanks for your post.

    Can you clarify:

    1) Is this on Live, replay or backtest data? (If live, whom is the datafeed from?)
    2) What bar type are you using?
    3) What is the setting of CalculateOnBarClose, true or false?
    4) What exit order method are you using?
    PaulNinjaTrader Customer Service

    Comment


      #3
      Hi Paul,

      Thanks fo rthe reply,

      This is on a back test at present, using candlestick bars, I have tried both true and false for CalculateOnBarClose but the back test appears to have the same results.

      Is there anything else you could advise,

      thanks,

      Daniel

      Comment


        #4
        Hello dannypark100,

        Thanks for your reply.

        When backtesting or looking at historical data, the strategy will execute the same as CalculateOnBarClose = true because the data only contains the open/high/low and close of the bar and does not contain all of the ticks of the bar. The strategy then executes once, at the end of each bar. If the strategy determines an exit condition in that bar, the exit does not occur until the next bar.

        You can add a faster time frame data series to your strategy to provide more opportunities to exit sooner. Here is a link to a reference sample that demonstrates this: Backtesting NinjaScript Strategies with an intrabar granularity

        Alternatively, you can use Market Replay and test your strategy with CalculateOnBarClose = false. Slower but closer to live conditions.
        PaulNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by afoschini, Today, 09:21 AM
        1 response
        5 views
        0 likes
        Last Post NinjaTrader_ChrisL  
        Started by Leope, Today, 09:37 AM
        1 response
        2 views
        0 likes
        Last Post NinjaTrader_RyanS  
        Started by svadukia, Today, 04:38 AM
        1 response
        3 views
        0 likes
        Last Post NinjaTrader_PatrickH  
        Started by dmackay41, Today, 12:50 AM
        3 responses
        23 views
        0 likes
        Last Post NinjaTrader_Kate  
        Started by ahrt|, Today, 08:37 AM
        2 responses
        10 views
        0 likes
        Last Post ahrt|
        by ahrt|
         
        Working...
        X