Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Entering Position based on an EMA after Conditions are met in Strategy Builder

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

    Entering Position based on an EMA after Conditions are met in Strategy Builder

    Say I have a strategy setup in Strategy Builder and once the conditions are true, I want to go long (or short) using the price based on where the 3 Bar EMA is at during that time.

    So, in other words, the conditions are met... it's time go long (or short) and I want to place a limit order at whatever price that the EMA is showing for that bar is. How would I do that?

    And when I say "that bar" I mean the current bar, which I guess would be after the "signal" bar. ie. the system (I guess) checks for the conditions to be met, when they are... it puts in an order right after the close of the signal bar (that bar that just closed and where the conditions were met is what I'm calling the "signal bar")... would it use the EMA from the signal bar... or the bar immediately following the close of the signal bar? And how would we adjust it to use the EMA of the signal bar if we wanted to or the current bar (the bar after the signal bar).

    Also, say for example that the current bar's price didn't go far enough to ht the limit order price and enter me into the trade... and now a new bar is being produced... and has a new/updated EMA... how can I make it so the system will update that original limit price to the new current EMA value? So in essence... my limit order follows along as new bars are getting produced and updates the limit order until I enter into the trade?

    And can I limit the "following" of that for say 4 or 5 bars... if it's still not hit by then, just cancel the order and start looking for the conditions again te be met... ie. resume the strategy.

    #2
    Hello TicksBandit,

    Thanks for your post.

    To enter a limit order based on the price of an indicator, in the action section of the strategy builder, click Add, then select the folder "Order Management", next select the type of limit order, next in the "limit price" hover the mouse over the field and when you see "set" appear, left click on "set", this will open the "Value" window where you can then select the indicator from the indicators folder.

    The bar/value that is used is the value when the action is executed which would be at the end of the bar that the condition was true.

    In the managed approach, an entry order that is not filled is cancelled at the end of the bar automatically. If your conditions are still true for the entry, then a new entry would be made on the next bar using the current bars value of the EMA.

    I'm unsure of how you can limit the "following", it may be possible with the strategy builder. Alternatively, you can unlock the code and limit the "following" by using a counter and logic to check the counter.
    Paul H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by DJ888, 04-16-2024, 06:09 PM
    4 responses
    12 views
    0 likes
    Last Post DJ888
    by DJ888
     
    Started by terofs, Today, 04:18 PM
    0 responses
    9 views
    0 likes
    Last Post terofs
    by terofs
     
    Started by nandhumca, Today, 03:41 PM
    0 responses
    6 views
    0 likes
    Last Post nandhumca  
    Started by The_Sec, Today, 03:37 PM
    0 responses
    3 views
    0 likes
    Last Post The_Sec
    by The_Sec
     
    Started by GwFutures1988, Today, 02:48 PM
    1 response
    9 views
    0 likes
    Last Post NinjaTrader_Clayton  
    Working...
    X