Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

scale into order based on price and adjust profit target??

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

    scale into order based on price and adjust profit target??

    Hi,

    I want to fade a stock moving higher with preset entries based on the previous bar. Sudo code would be like this
    1. if last price > high of last bar and
    price = high of the day and
    current bar (5 min) is not first bar of day and
    current bar (5min) is not > than the 10th bar of the day then
    1. sell limit order X # of shares at price of last bar + .02 and
    2. sell limit 100 shares every .25 higher
    end if

    -ALSO- I need a profit target
    so upon the first order being fullfilled a buy to cover limit order of .50 to be entered and for each additional 100 shares sold higher a CHANGE in the profit target order price and quantity to reflect the total amount of shares short AND the current average price of the shares sold. I want to maintain the profit target of .50 per share but have the actual limit price move higher as my average cost basis goes higher with each additional short.

    I would like to be able to do this on NT7 as that appears to be coming out shortly.

    Any direction would be great so that I can start using ninja to automate my trading.

    Thank you

    Robert

    #2
    Robert, you would need to custom code this via NinjaScript programming - for the basic conditions, you can work with Close (lastprice), High and CurrentDayOHL (high of day) -



    To access the bar count, use CurrentBar -



    Do you want to issue scale in orders until a certain size is filled?

    You can use Position.Quantity to check for this - http://www.ninjatrader-support.com/H.../Quantity.html

    For the Profit Target, you can use SetProfitTarget while ensuring to use uniquely named entry orders that you can tie the targets to.

    You can move targets and stops with this sample concepts -

    BertrandNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Segwin, 05-07-2018, 02:15 PM
    14 responses
    1,788 views
    0 likes
    Last Post aligator  
    Started by Jimmyk, 01-26-2018, 05:19 AM
    6 responses
    837 views
    0 likes
    Last Post emuns
    by emuns
     
    Started by jxs_xrj, 01-12-2020, 09:49 AM
    6 responses
    3,293 views
    1 like
    Last Post jgualdronc  
    Started by Touch-Ups, Today, 10:36 AM
    0 responses
    13 views
    0 likes
    Last Post Touch-Ups  
    Started by geddyisodin, 04-25-2024, 05:20 AM
    11 responses
    63 views
    0 likes
    Last Post halgo_boulder  
    Working...
    X