Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 Waxavi, Today, 02:10 AM
    0 responses
    6 views
    0 likes
    Last Post Waxavi
    by Waxavi
     
    Started by TradeForge, Today, 02:09 AM
    0 responses
    11 views
    0 likes
    Last Post TradeForge  
    Started by Waxavi, Today, 02:00 AM
    0 responses
    2 views
    0 likes
    Last Post Waxavi
    by Waxavi
     
    Started by elirion, Today, 01:36 AM
    0 responses
    4 views
    0 likes
    Last Post elirion
    by elirion
     
    Started by gentlebenthebear, Today, 01:30 AM
    0 responses
    5 views
    0 likes
    Last Post gentlebenthebear  
    Working...
    X