Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Price levels for entries

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

    Price levels for entries

    Hi all,

    How can I set buy/sell orders based on previous price levels?

    For example, the gold is trading at 1285.
    • If it came from 1280, I want to set buy stop order at 1290.
    • If it came from 1290, I want to set sell stop order at 1280.


    Thanks

    #2
    Hello fwz123,

    Thank you for your note.

    There would be a number of ways to accomplish this, one way I could think of would be to use a for loop, which would loop back a number of bars until the price traded above/below 1290 or 1280, at which point you could set a variable equal to 1 or 2, then break the for loop. Then you could check the value of this variable and if the variable equals 1, you would submit a stop market order above or below your desired bands.

    You could see the following example for some examples of using loops,


    I do not have any examples which would demonstrate how to do this exactly but I would encourage you to search google for loops and the use of breaks in them.

    If you need further assistance I could have someone reach out with a list of third parties that would be interested in developing this for you.

    Please let us know if you need further assistance.
    Alan P.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    557 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    324 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    545 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    547 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X