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 -

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    77 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    45 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    27 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    32 views
    0 likes
    Last Post TheRealMorford  
    Started by Mindset, 02-28-2026, 06:16 AM
    0 responses
    63 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X