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

wizard problem...

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

    wizard problem...

    i am attempting to build a script in the strategy wizard that opens a position as a market order at the close of a bar (no matter what the price is) and then closes that position as a market order at the close of the first future bar that closes higher than the entery price.... no matter how far the price has moved, whether it is 1 tick or 500 ticks.

    i have it set to 'calculate on bar close' and i set the 'profit target' as 1 tick greater than the entery price, but doing and then running a backtest just closes the position within the very same bar that the position entered, such that it enters the position and then exits it in the same bar at 1 tick without waiting to calculate the next bar.

    i want the position to open a market order on a bar close, then wait for the next bar to see if the close is higher. if it is, it closes the position as a market order. if it is not, it keeps the position open until the next bar, and continues to keep the position open until it closes a bar that is higher than the entry price.

    #2
    Not sure I follow 100% -

    - Why put in a 1 tick profit target if your only exit condition is Close > Avg Entry Price?
    - If you removed this profit target and only had your exit condition then your strategy will do exactly what you I believe to understand you want
    RayNinjaTrader Customer Service

    Comment


      #3
      yes, i am wanting to close the ENTIRE position if the close is above the average, like you said, but not JUST that.... i want each individual entry to exit on a higher close as well, even if, especially if, the 'average' price is not breached. for example.

      buy EUR/USD at closing prices of: 1.3000, 1.2950, and 1.2900 in three consecutive bars. the average price is now 1.2950, but i don't want to wait until THAT price is breached in order to sell a single position. after entering the three trades above, if the price on the next bar would rise to a close of 1.2935, trying to just exit above the 'average' would not trigger a trade, whereas i DO want it to still exit the 1.2900 position, for a profit of 0.0035.

      again, since it is a new bar i still want it to open a new position, which in this example is 1.2935.....there would now be an open position of three trades (1.3000, 1.2950, 1.2935...... the 1.2900 entry having closed) at an average of 1.2962. if the price would then close on the next bar at 1.2980 it would exit all remaining trades, still opening a new one at 1.2980 to continue the strategy forward with a single open position.

      or, it could drop back further on the next bar to, say, 1.1950 and enter another trade on that bar. the average of the, now, four entries (1.3000, 1.2950, 1.2935, 1.1950) would be 1.2709. but, if there is then a bar close above 1.1950, say 1.2000, i want it to exit the 1.1950 position for a profit of 0.0050, again still leaving the 1.3000, 1.2950, and 1.2935 positions, and enter a new position at 1.2000 for a new 4-position average of 1.2721...

      or if instead it made it all the way back up to close above the average position of 1.2709, say at 1.2750, it would then exit all four trades and flatten the position, still opening a new one at 1.2750 and continue the strategy now with just a single open poistion again.

      etc.....

      Comment


        #4
        Hello,

        The nature of your strategy is complex and can be a bit difficult to implement in the Strategy Wizard. You may need to use custom NinjaScript programming to make this work.

        If you want you could try contacting one of our 3rd party NinjaScript consultants here:
        DenNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by 00nevest, 04-27-2024, 02:27 PM
        3 responses
        27 views
        0 likes
        Last Post 00nevest  
        Started by Newtrader101, Today, 07:36 AM
        0 responses
        1 view
        0 likes
        Last Post Newtrader101  
        Started by 21laienoch, Today, 07:25 AM
        0 responses
        5 views
        0 likes
        Last Post 21laienoch  
        Started by burtoninlondon, 04-28-2024, 12:38 AM
        1 response
        16 views
        0 likes
        Last Post burtoninlondon  
        Started by MacDad, 02-25-2024, 11:48 PM
        8 responses
        175 views
        0 likes
        Last Post NinjaTrader_Erick  
        Working...
        X