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:



    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.



    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 FAQtrader, Today, 12:00 PM
    0 responses
    2 views
    0 likes
    Last Post FAQtrader  
    Started by gnocchi, Today, 11:56 AM
    0 responses
    2 views
    0 likes
    Last Post NinjaTrader_Zachary  
    Started by geddyisodin, Today, 05:20 AM
    5 responses
    32 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by bmartz, Today, 09:30 AM
    2 responses
    13 views
    0 likes
    Last Post bltdavid  
    Started by f.saeidi, Today, 11:02 AM
    1 response
    5 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Working...
    X