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

conceptual question.

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

    conceptual question.

    Hi,

    I have a couple of conceptual question.

    When I use "CalculateOnBarClose = true".

    Using, for exemple: " if(Close[0] > SMA(8)[0]) {EnterLong("Entra Comprado")}" , and the CurrentBar is 1234.

    This condition only is defined, and open a buy, after the bar (N. 1234) is closed. If the timeframe is 10 min, for example, the value of de Close[0] and SMA(8)[0] values will vary, but so be defined when the bar closed.

    In the case of the stop loss and target profit, when the value of market reaches the value of the of stop loss and target profit, the trade will be closed in the value of the stop loss or in of the target profit. Is that correct ?

    Also on the chart when the closing of the bar number 1234 and the condition "Close [0> SMA (8) [0]" are met, a new trade will be to open in bar number 1235. Can you also confirm this??

    If the value of market reaches the value of stop loss or target profit in the bar n. 1234 the trade will be closed . even if the bar is not closed.

    #2
    Umm, yes to all your questions.

    But the best way to learn this, is to test this out on your own and verify.

    Comment


      #3
      Hello ocorrea,

      Thank you for your post.

      So the strategy must trade only on the 1234 bar? Or any point after the bar closes?

      Comment


        #4
        The strategy can trade any point after the bar closes.

        Comment


          #5
          Hello ocorrea,

          Thank you for your patience.

          The condition would be the following:
          Code:
          if(CurrentBar >= 1234)
          {
          // check for entry condition
          }

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by helpwanted, Today, 03:06 AM
          1 response
          10 views
          0 likes
          Last Post sarafuenonly123  
          Started by Brevo, Today, 01:45 AM
          0 responses
          8 views
          0 likes
          Last Post Brevo
          by Brevo
           
          Started by aussugardefender, Today, 01:07 AM
          0 responses
          5 views
          0 likes
          Last Post aussugardefender  
          Started by pvincent, 06-23-2022, 12:53 PM
          14 responses
          242 views
          0 likes
          Last Post Nyman
          by Nyman
           
          Started by TraderG23, 12-08-2023, 07:56 AM
          9 responses
          386 views
          1 like
          Last Post Gavini
          by Gavini
           
          Working...
          X