• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Help: Create Order with Stop Loss and Target when user input price is met

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

    Help: Create Order with Stop Loss and Target when user input price is met

    Hi I am new to ninja trader strategy development buy I have an experience in c# programming. I would like to find out how I can this. A sample code would be helpful for me to get started.
    Example:

    1. Buy GPBUSD
    User Input: EntryPrice , StopLoss, Target1, Target2

    If EntryPrice is equal or greater than the current price (realtime)
    Place Order at Entry Price
    Place StopLoss
    Place Target1and Target2

    2. How can I read an existing pending order in the nt strategy code?

    Read pending order in the current chart for the current currency pair / current time frame
    Place StopLoss
    Place Target.

    Thanks very much

    #2
    Hello mgarier01,

    Thank you for your note.

    You would have to create user inputs so that the user could pass the Entry Price, stop loss and profit targets to the strategy, you could see the following example,
    https://ninjatrader.com/support/foru...73&postcount=2

    At the following link you should see the SetProfitTarget, SetStopLoss, and Enter Methods for setting up your strategies order logic,
    https://ninjatrader.com/support/help...d_approach.htm

    To loop through working orders you could see the following section of the helpguide containing a loop,
    https://ninjatrader.com/support/help...rs_account.htm

    Regarding setting up the logic, I would suggest working in the strategy builder.

    The following will introduce you to the strategy builder;

    Strategy Builder Intro: 7 Minutes
    https://www.youtube.com/watch?v=xpgC...vDBcC&index=32

    Strategy Builder NT8:
    https://www.youtube.com/watch?v=HCyt...We0Nf&index=10

    See the NinjaScript Editor Youttube,
    https://www.youtube.com/watch?v=Q06x...ZmVnauWXkWe0Nf

    A link to our Help Guide NinjaScript section can be found here,
    https://ninjatrader.com/support/help...injascript.htm

    Click here to see our NinjaScript Reference Samples:
    http://ninjatrader.com/support/forum...splay.php?f=30

    You can also contact a professional NinjaScript Consultants who would be eager to create or modify a script at your request or assist you with your script. Please let me know if you would like our business development follow up with you with a list of professional NinjaScript Consultants who would be happy to create this script or any others at your request.

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

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by firstlanetech, Today, 01:05 AM
    0 responses
    2 views
    0 likes
    Last Post firstlanetech  
    Started by HiddenPhilosopher, Yesterday, 11:58 PM
    0 responses
    3 views
    0 likes
    Last Post HiddenPhilosopher  
    Started by glennts, Yesterday, 08:24 PM
    2 responses
    13 views
    0 likes
    Last Post bltdavid  
    Started by ibabinov, 11-12-2019, 09:50 AM
    3 responses
    66 views
    0 likes
    Last Post NinjaTrader_ShawnB  
    Started by PrimoItch, 05-27-2020, 04:35 PM
    2 responses
    18 views
    0 likes
    Last Post bkonia
    by bkonia
     
    Working...
    X