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 WHICKED, Today, 12:45 PM
        1 response
        10 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by samish18, Today, 01:01 PM
        0 responses
        5 views
        0 likes
        Last Post samish18  
        Started by WHICKED, Today, 12:56 PM
        0 responses
        8 views
        0 likes
        Last Post WHICKED
        by WHICKED
         
        Started by Spiderbird, Today, 12:15 PM
        2 responses
        11 views
        0 likes
        Last Post Spiderbird  
        Started by FrazMann, Today, 11:21 AM
        2 responses
        8 views
        0 likes
        Last Post NinjaTrader_ChristopherJ  
        Working...
        X