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

Pivot point as stoploss

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

    Pivot point as stoploss

    Hello there,
    I'm working on a different stoploss. The goal is to use the pivot point indicator and use the S3 as my stoploss value.
    I setup the indicator and it works fine and shows the lines/values on my chart. However when I use setstoploss it doesn't set a stoploss.
    Code:
    Pivots1                = Pivots(Close, PivotRange.Monthly, HLCCalculationMode.DailyBars, 0, 0, 0, 20); This is the line for the pivots
    SetStopLoss("@", CalculationMode.Price, Pivots1.S3[0], false); this is the line for the stoploss

    #2
    Hello SebastiaanR,

    Thank you for your post.

    Debugging steps should be taken to monitor the strategy as it is executing to determine why the SetStopLoss order was ignored.

    In order to better understand how the code is working, I recommend adding some debugging prints to your strategy. By adding debugging prints for the values used to evaluate your conditions, outside of those conditions you can observe if the strategy's logic is allowing your order submission methods to fire.

    If you are seeing your order submission being reached, but it is not executing, there may be an issue where the strategy is hitting an internal rule that is not allowing you to re-enter. TraceOrders can be used in the strategy (set in State.SetDefaults or in the Strategy Builder under Default Properties) so it prints its order feedback, and you may also observe the log tab of the Control Center for additional information.

    Some items to check when you are taking debugging steps:
    1. Are your strategy's conditions allowing your order submission methods to be reached?
    2. Is the strategy currently in a position that is preventing it from submitting another entry order?
    3. Do you see any errors in the log tab of the Control Center or do Trace Orders give you any feedback?
    I've included some tips for debugging below.

    Debugging Tips - https://ninjatrader.com/support/help...script_cod.htm

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

    Debugging in the Strategy Builder - https://drive.google.com/file/d/1mTq...w?usp=drivesdk

    Debugging Demo - https://drive.google.com/file/d/1rOz...w?usp=drivesdk

    Please let us know if we may assist further.
    Brandon H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by quantismo, 04-17-2024, 05:13 PM
    4 responses
    30 views
    0 likes
    Last Post quantismo  
    Started by love2code2trade, 04-17-2024, 01:45 PM
    4 responses
    31 views
    0 likes
    Last Post love2code2trade  
    Started by cls71, Today, 04:45 AM
    2 responses
    10 views
    0 likes
    Last Post eDanny
    by eDanny
     
    Started by proptrade13, Today, 11:06 AM
    0 responses
    5 views
    0 likes
    Last Post proptrade13  
    Started by kulwinder73, Today, 10:31 AM
    1 response
    10 views
    0 likes
    Last Post NinjaTrader_Erick  
    Working...
    X