Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

some help with ninjascript trade management please.

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

    some help with ninjascript trade management please.

    Ok, I am digging into ninja script for making a strategy, I have done a small amount of c# scripting for game development a few years back, and have got my script where it picks out the signals I want to trade, but I'm having heck figuring out how to make it work, I spent a while in a video tute with no luck before I found out that it was old and IOrder was no longer used. then I found my way here. https://ninjatrader.com/support/help...and_onexec.htm but when I try and set the order variable as shown "private Order entryOrder = null;" I get the error Severity Code Description Project File Line Suppression State
    "Error CS0104 'Order' is an ambiguous reference between 'NinjaTrader.Cbi.Order' and 'NinjaTrader.CQG.ProtoBuf.Order' NinjaTrader.Custom "

    I have included an image to help explain what behavior I am looking for. for this example I will use the second set of signals, you can see I have a set of diamonds, red: stop, green: entry, silver: first target, gold: second target (tho I believe I will change this to be a runner,)

    so here's what I need
    A signal is placed: enter 2 stoplimit orders at the green diamond with no expiration (i believe that's the kind I want I'm still a bit confused about the different entries). if the price rises to hit the green diamond price before falling to the red diamond price, the order is filled and 2 long positions are entered, if it falls to the stop loss first, the orders are canceled and the strat resets and looks for a new entry.

    if the positions are filled when the price gets to the silver target, one of the orders should be filled, and the stop loss should move to 1pt above breakeven, if the price moves up to the gold target, the top moves to the silver target, and so on and on moving the price up in those increments until it it gets stopped out.

    I also am looking later to implement a setting to allow it to stack orders from multiple entries, but I am not worried about that in this iteration.

    I am not looking for someone to do this for me, but just some tips about how to go about this, or what resources I could look at. Thanks


    #2
    Hello CoffeeOutlaw,

    For the error you are getting you likely have a problem with the using statements at the top of the file. The most simple way to correct this is to generate a new empty strategy and then copy all of the using statements from that script over the using statements in your current script.

    If you need to learn more about the order types you can use a public trading resource like investopedia to learn about types (Limit, stop market, market, etc). The NinjaScript api/platform will follow the standard market terms for order types so that information would be relevant here. You can also place trades manually in the chart trader to learn how they can be used.

    For the other parts you would need to break this down to the individual parts you want to accomplish. We can go over each that you are not clear about, for example drawing or building conditions. The existing scripts in the NinjaScript editor are a good learning resource if you need to know about the standard NinjaScript code that can be used. You can also download third party items from the public user app share to explore other concepts.


    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Ray12345, Today, 04:10 AM
    0 responses
    2 views
    0 likes
    Last Post Ray12345  
    Started by Behungr101, Today, 02:16 AM
    1 response
    8 views
    0 likes
    Last Post NinjaTrader_Jason  
    Started by omermirza, Yesterday, 08:37 PM
    2 responses
    12 views
    0 likes
    Last Post NT-Roland  
    Started by aelagha, Today, 01:28 AM
    1 response
    12 views
    0 likes
    Last Post NinjaTrader_Jason  
    Started by Lowerlevel1, Today, 12:26 AM
    0 responses
    6 views
    0 likes
    Last Post Lowerlevel1  
    Working...
    X