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

Where's the StopLoss

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

    Where's the StopLoss

    At some point in my script I need to check what price the StopLoss is at. I'm using 'Ticks' to initially set the StopLoss. How can I check this?

    #2
    Hello Bluebeep, Thanks for your post.

    You would need to calculate this with your code. When you say "set a stop loss at x ticks" that means to set the stop x ticks away from your average entry, whatever that price may be. Set up a int variable at the class level that represents the tick value being used, then if you are long, the price the stop will be at will be written as such: var stopprice = Close[0]-TickSize*<number of ticks for the stop>.

    Best regards.
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      That makes sense I'll use it. Thanks. However, as a possibility this might help for the future (maybe a feature request, and maybe to make things a bit easier) - there's a line on my screen where the stop-loss is. Give me a hook so I can get it's value. For example: Your.Cool.Stoploss[0]. Would be amazing to grab Your.Cool.Stoploss[1] no?

      Comment


        #4
        Hi Bluebeep, thanks for your reply.

        I will submit a feature request to add a stop loss collection property to easily access stop loss values.
        Chris L.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by giulyko00, 04-24-2024, 12:03 PM
        9 responses
        43 views
        0 likes
        Last Post giulyko00  
        Started by memonic, Yesterday, 01:23 PM
        2 responses
        25 views
        0 likes
        Last Post memonic
        by memonic
         
        Started by merc410, Today, 03:41 AM
        2 responses
        16 views
        0 likes
        Last Post merc410
        by merc410
         
        Started by sugalt, 04-30-2024, 04:02 AM
        2 responses
        13 views
        0 likes
        Last Post sugalt
        by sugalt
         
        Started by Ndakotan1313, 03-14-2024, 05:02 PM
        2 responses
        64 views
        0 likes
        Last Post blaise_code  
        Working...
        X