Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Orders are placed at Open price - Bollinger Band

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

    Orders are placed at Open price - Bollinger Band

    Hi all,

    I am building a strategy and using Bollinger band as a indicator using wizard. My condition is as below. Please note I am new and trying to do this using wizard. So don't want to unlock and add code.

    if (CrossBelow(Close, Bollinger(2, 14).Lower, 1))
    {
    EnterLong(DefaultQuantity, "LongOrder");
    }

    // Condition set 2
    if (CrossAbove(Close, Bollinger(2, 14).Upper, 1))
    {
    ExitLong("SellLong", "");

    My problem is order is always entered at open price and not closing price. Order is always closed at again open price and not at closing price of a bar.

    This reduces my profit. Is there another way to do this within a wizard?

    #2
    Hello,

    Thank you for the question.

    Can you tell me, are you testing this in Realtime or another mode such as a Backtest? Also could you provide an image of the result you are getting to better see what may be happening?

    The syntax as it is now should submit orders when OnBarUpdate is called, this would either be on each tick or on the Close of the bar depending on the CalculateOnBarClose setting.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Orders are placed at Open price - Bollinger Band

      I am testing it in backtest mode. Enclosing screen shot for your reference.
      Attached Files

      Comment


        #4
        Hello,

        Thank you for the details, this helps explain the result.

        In this case what you are seeing would be expected based on the fill types of the back test. If the order is a market type, You would see the visual placed on the next bar or at the bar open. The Bar would be evaluated and if your condition is true and submits an order, that order would be placed on the following bar. In realtime you would see a slightly different action, you can find more about the differences between backtesting and realtime here: http://ninjatrader.com/support/helpG...htsub=backtest



        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          Orders are placed at Open price - Bollinger Band

          Thanks for the reply.

          One more question - how do I use user variables? Are they accessible via wizard for use in calculations?

          Like I want to close position if open price falls below my order price?

          close position = if Open falls below (average position price - 10%(average position price)).
          say long order was placed at $ 100
          Now stock is going down
          I want to close order if price falls to $90

          Comment


            #6
            Hello,

            The User variables can be used in the wizard for storing values such as a calculated price. There are limitations to this as you can note while setting the value of the variable.

            In the "Do the following" section you would add an action, select Misc -> Set user defined variable.
            For the value, you can select the row and click the (...) button to the right to see your options.

            For what you are trying to accomplish, you could select Strategy->AveragePositionPrice and provide an offset to create the value you want.

            You would need to do this before using it in another set, so you would need to consider the existing logic and set the value where appropriate.

            In another set, you could compare against the user defined variable to execute a condition.

            I look forward to being of further assistance.
            JesseNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by love2code2trade, Yesterday, 01:45 PM
            4 responses
            28 views
            0 likes
            Last Post love2code2trade  
            Started by funk10101, Today, 09:43 PM
            0 responses
            7 views
            0 likes
            Last Post funk10101  
            Started by pkefal, 04-11-2024, 07:39 AM
            11 responses
            37 views
            0 likes
            Last Post jeronymite  
            Started by bill2023, Yesterday, 08:51 AM
            8 responses
            44 views
            0 likes
            Last Post bill2023  
            Started by yertle, Today, 08:38 AM
            6 responses
            26 views
            0 likes
            Last Post ryjoga
            by ryjoga
             
            Working...
            X