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 inanazsocial, Today, 01:15 AM
          0 responses
          2 views
          0 likes
          Last Post inanazsocial  
          Started by trilliantrader, 04-18-2024, 08:16 AM
          5 responses
          22 views
          0 likes
          Last Post trilliantrader  
          Started by Davidtowleii, Today, 12:15 AM
          0 responses
          3 views
          0 likes
          Last Post Davidtowleii  
          Started by guillembm, Yesterday, 11:25 AM
          2 responses
          10 views
          0 likes
          Last Post guillembm  
          Started by junkone, 04-21-2024, 07:17 AM
          9 responses
          71 views
          0 likes
          Last Post jeronymite  
          Working...
          X