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 ZenCortexCLICK, Today, 04:58 AM
    0 responses
    5 views
    0 likes
    Last Post ZenCortexCLICK  
    Started by sidlercom80, 10-28-2023, 08:49 AM
    172 responses
    2,280 views
    0 likes
    Last Post sidlercom80  
    Started by Irukandji, Yesterday, 02:53 AM
    2 responses
    18 views
    0 likes
    Last Post Irukandji  
    Started by adeelshahzad, Today, 03:54 AM
    0 responses
    7 views
    0 likes
    Last Post adeelshahzad  
    Started by Barry Milan, Yesterday, 10:35 PM
    3 responses
    13 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Working...
    X