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

Order Profit target bug

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

    Order Profit target bug

    Good afternoon!

    At me such problem is not put profit target on a signal! and the stop loss and exit work fine here is the code

    EMA3 = EMA(Low, Convert.ToInt32(VFAST));
    EMA4 = EMA(High, Convert.ToInt32(VFAST));
    double DELTA = Math.Round(Math.Abs((Close[0]-Open[0])/TickSize),0);
    //Print(DELTA);
    if (Position.MarketPosition == MarketPosition.Long && Close[0] < EMA3[0])
    {
    SetProfitTarget(CalculationMode.Price, Close[0]+(DELTA*2)*TickSize);
    SetStopLoss(@"", CalculationMode.Price, Close[0]-DELTA*TickSize, false);
    }
    if (Position.MarketPosition == MarketPosition.Short && Close[0] > EMA4[0])
    {
    SetProfitTarget(CalculationMode.Price, Close[0]-(DELTA*2)*TickSize);
    SetStopLoss(@"", CalculationMode.Price, Close[0]+DELTA*TickSize, false);
    }

    On the first screenshot, the result of the job profit is the target and the stop loss. In the second screenshot, only one stop loss, which works fine on the strategy! Tell me how to solve the problem so that stop loss and profit target are set only on signal.



    Last edited by oscsoft; 04-07-2018, 07:30 PM.

    #2
    Hello oscsoft,

    Thank you for your note.

    Are you seeing an errors on the log tab when running the strategy?

    If you apply the strategy to a candlestick chart rather than the bar type you are using, are you still seeing the same behavior?

    I’ve provided some links which you may find helpful on debugging.

    Debugging: http://ninjatrader.com/support/forum...ead.php?t=3418
    TraceOrders: http://ninjatrader.com/support/forum...ead.php?t=3627

    I look forward to your reply.
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      Order Profit target bug

      >>Are you seeing an errors on the log tab when running the strategy?

      Errors not detected log is normal!

      >>If you apply the strategy to a candlestick chart rather than the bar type you are using, are you still seeing the same behavior?

      The candlestick chart is exactly the same behavior!

      >>I’ve provided some links which you may find helpful on debugging.

      When the line is locked //SetProfitTarget(CalculationMode.Price, Close[0]+(DELTA*2)*TickSize); the strategy works fine (only the stop loss) also checked all the data!

      Comment


        #4
        Hello oscsoft,

        Could you please send an email to platformsupport[at]ninjatrader[dot]com with Attn: Alan P in the Subject line. Also within the email please include a link to this thread, and attach the log and trace files for the day in subject which you can find in My Documents>NinjaTrader8>Log and My Documents>NinjaTrader8/Trace folders.

        Please also provide the times you ran the strategy so I may reference the log and trace file during those times.

        I look forward to your email.
        Alan P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by PaulMohn, Today, 03:49 AM
        0 responses
        6 views
        0 likes
        Last Post PaulMohn  
        Started by inanazsocial, Today, 01:15 AM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_Jason  
        Started by rocketman7, Today, 02:12 AM
        0 responses
        10 views
        0 likes
        Last Post rocketman7  
        Started by dustydbayer, Today, 01:59 AM
        0 responses
        4 views
        0 likes
        Last Post dustydbayer  
        Started by trilliantrader, 04-18-2024, 08:16 AM
        5 responses
        23 views
        0 likes
        Last Post trilliantrader  
        Working...
        X