• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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.
    Patrick H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by chafan11, Today, 09:28 PM
    0 responses
    5 views
    0 likes
    Last Post chafan11  
    Started by GreenspanAlec, Today, 05:32 PM
    0 responses
    6 views
    0 likes
    Last Post GreenspanAlec  
    Started by mrwarkhan, Today, 03:45 PM
    0 responses
    13 views
    0 likes
    Last Post mrwarkhan  
    Started by momchi, Yesterday, 10:09 PM
    3 responses
    12 views
    0 likes
    Last Post NinjaTrader_ChrisL  
    Started by Jesus Medina, Today, 02:43 PM
    0 responses
    6 views
    0 likes
    Last Post Jesus Medina  
    Working...
    X