Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Buy or Sell 5points below or above the opening price ES

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

    Buy or Sell 5points below or above the opening price ES

    I would like to create an EA for this strategy.
    This is for the S&P mini (ES).
    To buy when the price is 5points below the opening price for this day (9:30)
    and to sell when the price is 5points above the opening price for the day.
    Maybe 2x the ATR for the distance from the opening price or 5points.

    And i need a stop and a target for this strategie in both ways.
    Maybe a trailing stop.
    To buy or sell by limit not by market order.
    If one of them is filled first the other need to canceld at the same time.

    Thank you for your help

    #2
    Hello babaunddeda,

    Thank you for your post and welcome to the NinjaTrader Support Forum!

    You can use CurrentDayOHL for the open: http://www.ninjatrader.com/support/h...nt_day_ohl.htm

    Limit Orders would be needed for buys below the market and sells above the market. You can find the Order Methods in NinjaScript at the following link: http://www.ninjatrader.com/support/h...er_methods.htm
    The SetStopLoss and SetProfitTarget are also available within the Order Methods listed above.

    However, cancelling when the other fills would require OCO ids, which are available in the Unmanaged Approach but this would not allow SetStopLoss or SetProfitTarget to work. So you could simply ensure the Limit orders are only active when the market is flat by using the Position.MarketPosition: http://www.ninjatrader.com/support/h...etposition.htm

    Please let me know if I may be of further assistance.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by f.saeidi, Today, 11:02 AM
    0 responses
    0 views
    0 likes
    Last Post f.saeidi  
    Started by geotrades1, Today, 10:02 AM
    3 responses
    10 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Started by rajendrasubedi2023, Today, 09:50 AM
    3 responses
    15 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Started by lorem, Today, 09:18 AM
    2 responses
    11 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by geddyisodin, Today, 05:20 AM
    4 responses
    30 views
    0 likes
    Last Post geddyisodin  
    Working...
    X