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

entry the next candle with Calculate.OnEachTick

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

    entry the next candle with Calculate.OnEachTick


    Hello, I am developing a strategy and I want to enter at the tick of the next candle. I did this, but it doesn't work for me. If anyone knows what's wrong, I'd appreciate it.

    Attached Files

    #2
    Hi, thanks for writing in. If this is not working in the historical backtest, please enable Tick Replay so the IsFirstTickOfBar condition will trigger historically. If you continue to run into issues, please Export your strategy and post it here so I can test it.

    Kind regards.
    Chris L.NinjaTrader Customer Service

    Comment


      #3

      Thanks for answering. the strategy does not carry out operations neither in live nor in historical data. Just in case I use range candles
      Attached Files

      Comment


        #4
        Hi, thanks for posting that. Please call Update() on the BuySellPressure object since the script is running OnEachTick e.g.

        Code:
        if (BarsInProgress != 0)
        return;
        
        if (CurrentBars[0] < 1)
        return;
        
        BuySellPressure1.Update();
        
        if (IsFirstTickOfBar)
            //continue with entry logic.
        Chris L.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by yertle, Yesterday, 12:24 PM
        1 response
        10 views
        0 likes
        Last Post yertle
        by yertle
         
        Started by Mr Bread, Today, 04:25 AM
        2 responses
        9 views
        0 likes
        Last Post Mr Bread  
        Started by kandise, Today, 09:41 AM
        0 responses
        2 views
        0 likes
        Last Post kandise
        by kandise
         
        Started by Mubeen Haider, Today, 09:41 AM
        0 responses
        5 views
        0 likes
        Last Post Mubeen Haider  
        Started by nicbizz, Today, 09:02 AM
        0 responses
        7 views
        0 likes
        Last Post nicbizz
        by nicbizz
         
        Working...
        X