• 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 Appause70, Today, 05:16 AM
    0 responses
    1 view
    0 likes
    Last Post Appause70  
    Started by wolfcuring, Today, 04:08 AM
    0 responses
    4 views
    0 likes
    Last Post wolfcuring  
    Started by cirzonorkecv, Yesterday, 11:52 PM
    0 responses
    7 views
    0 likes
    Last Post cirzonorkecv  
    Started by rickyblah12, Yesterday, 01:01 PM
    1 response
    14 views
    0 likes
    Last Post Erwin Beckers  
    Started by dadarara, Yesterday, 12:18 PM
    0 responses
    9 views
    0 likes
    Last Post dadarara  
    Working...
    X