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 LawrenHom, Today, 10:45 PM
    0 responses
    3 views
    0 likes
    Last Post LawrenHom  
    Started by love2code2trade, Yesterday, 01:45 PM
    4 responses
    28 views
    0 likes
    Last Post love2code2trade  
    Started by funk10101, Today, 09:43 PM
    0 responses
    7 views
    0 likes
    Last Post funk10101  
    Started by pkefal, 04-11-2024, 07:39 AM
    11 responses
    37 views
    0 likes
    Last Post jeronymite  
    Started by bill2023, Yesterday, 08:51 AM
    8 responses
    44 views
    0 likes
    Last Post bill2023  
    Working...
    X