• 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

How do I confirm the ProfitTarget and StopLoss?

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

    How do I confirm the ProfitTarget and StopLoss?

    I am running into instances where the values don't seem to be set correctly. Is there a function I can call to confirm the value?

    #2
    Hello morrnel,

    The first thing I would recommend would be to turn on the Order Trace function:

    Strategy Builder > Default Properties > More Properties > Trace Orders, or:

    if (State == State.SetDefaults)
    {
    TraceOrders = true;
    }

    Once you then recompile the strategy, you can open a new NinjaScript Output window under New > NinjaScript Output. This will print a log of any orders submitted by the strategy during while it's running, along with any ignored orders. You can then look through and see what may be occurring.

    Here is a link to our help guide that goes into more detail on tracing orders:

    https://ninjatrader.com/support/help...aceorders2.htm

    Trace orders alone won't give you the full picture of whether or not a order should have been entered at a particular price, so adding prints to your strategy that will show in the NinjaScript Output window, with information on what the variables you're using for your conditions are on a particular bar, can be helpful.

    This forum post goes into great detail on how to use prints to help figure out where issues may stem from — this should get you going in the correct direction. You can even add these using the Strategy Builder.

    https://ninjatrader.com/support/foru...ns-not-working

    If you run into issues like we saw here, the above information will allow you to print out all values used in the condition in question that may be evaluating differently. I'd suggest adding prints of the value you're using to set the stop and target prices right before you submit an order. With the printout information you can assess if a value may not be what you think it should be at that point.

    Please let us know if we may be of further assistance to you.
    Kate W.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by catinabag, Today, 06:09 AM
    0 responses
    6 views
    0 likes
    Last Post catinabag  
    Started by junposlee, Today, 02:59 PM
    0 responses
    1 view
    0 likes
    Last Post junposlee  
    Started by patpat, Yesterday, 11:02 AM
    2 responses
    8 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by jameslee001, Yesterday, 08:09 AM
    1 response
    9 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by ArthurH, Today, 11:52 AM
    0 responses
    7 views
    0 likes
    Last Post ArthurH
    by ArthurH
     
    Working...
    X