Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Entries being chased (unexpected)

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

    Entries being chased (unexpected)

    I have a script that puts in a long or short entry via

    EnterLongLimit(Lots, GetCurrentBid(), "Long")

    Or

    EnterShortLimit(Lots, GetCurrentAsk(), "Short");


    The initial price is exactly what I want. But it continually updates the would-be entry price with each price change.

    How do I tell a script to submit at a the current bid/ask and just sit there and wait to be filled and not update with each tick that adjusts the entry price?

    #2
    Hello LookOutBelow,

    One approach to this is using bool flags. Following is the general steps needed here.
    • Check the bool flag in the same condition you use to evaluate whether an order should be placed.
    • Set the bool the opposite direction in the same block that places the order.
    • Reset it somewhere - maybe when your market position == long.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Thanks for the quick response. I'll take a look at implementing something like this.

      While I have you.. I'm new to NT, so I don't know if this is the case or not. Is this to be expected with every script I make (if I place the order on the Bid for a buy and Ask for a short), or is this somehow related to the way I created the conditions?

      Thanks much.




      Originally posted by NinjaTrader_RyanM View Post
      Hello LookOutBelow,

      One approach to this is using bool flags. Following is the general steps needed here.
      • Check the bool flag in the same condition you use to evaluate whether an order should be placed.
      • Set the bool the opposite direction in the same block that places the order.
      • Reset it somewhere - maybe when your market position == long.

      Comment


        #4
        Yes, you will probably notice this more as you work with NinjaScript. It's a C# extension so you will see behaviour typical of a real programming language.

        In this case, it executes the statements if the code evaluates to true. If there has been an update to the values, these get updated as well.

        Using bool flags here is one approach but since you're working with a programming language there may be others as well. You will have a lot of flexibility with NinjaScript but of course there's always a challenge learning a new system.
        Ryan M.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Haiasi, 04-25-2024, 06:53 PM
        4 responses
        54 views
        0 likes
        Last Post effraenk  
        Started by ccbiasi, 11-23-2017, 06:06 AM
        5 responses
        2,199 views
        0 likes
        Last Post leodavis  
        Started by kujista, Yesterday, 12:39 AM
        2 responses
        14 views
        0 likes
        Last Post kujista
        by kujista
         
        Started by Austiner87, Yesterday, 11:24 AM
        2 responses
        12 views
        0 likes
        Last Post brucerobinson  
        Started by Rogers101, 05-05-2024, 11:30 AM
        3 responses
        21 views
        0 likes
        Last Post Rogers101  
        Working...
        X