• 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 sardana, Today, 05:52 AM
    0 responses
    2 views
    0 likes
    Last Post sardana
    by sardana
     
    Started by Mykro, Yesterday, 04:58 PM
    1 response
    11 views
    0 likes
    Last Post NinjaTrader_PaulH  
    Started by akuntysh, Today, 02:43 AM
    0 responses
    5 views
    0 likes
    Last Post akuntysh  
    Started by thgamey, Today, 02:05 AM
    0 responses
    9 views
    0 likes
    Last Post thgamey
    by thgamey
     
    Started by tpdk2012, Today, 12:51 AM
    1 response
    13 views
    0 likes
    Last Post NinjaTrader_ChrisSch  
    Working...
    X