Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Getting Real Entry price

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

    Getting Real Entry price

    This is likely really simple.
    Primary question:
    How do I set a stop loss off of a dynamic entry price (not really a "Close" or "open")?

    Secondary Question:
    Is there an index of methods and such that I can browse through to find information like this?

    Tertiary Question:
    When you set a stop loss through Ninjascript, is it set as OCO so it cancels out if the position fills?

    #2
    Hello alphatango,

    Thank you for your post.

    You could use SetStopLoss() to create a stop loss order:


    The calculation mode will determine whether the price of the stop loss order is an offset from the average entry price or an absolute price point.

    You may view all methods available in the Managed Approach here:


    The stop loss quantity will be represented by the entry if a fromEntrySignal value is used in the call of SetStopLoss(). Otherwise, the stop loss is tied to all entries and if the position becomes flat/fills then the stop loss iwll automatically be canceled.

    Something that is helpful to understand how certain conditions/actions would be set up programmatically in a strategy is to use the Strategy Builder to define different conditions/actions, and then click the "View Code" button to view the code in the NinjaScript Editor. Here are some examples of common conditions and actions in the Strategy Builder:Stops and Targets that use the Set() methods of the unmanaged approach may be configured via the Stops and Targets screen in the Strategy Builder, then they will also show up in the logic when the "View Code" button is clicked.

    Please let us know if we may be of further assistance.

    Comment


      #3
      Is there a way to reference the "fromEntrySignal"? I see that in the SetStopLoss and SetProfitTarget. That would be a valuable thing to have stored as a Position note.

      (I can use them for "if" statements; if ("mylongentry") ... else if ("myshortentry"), etc)

      Comment


        #4
        Originally posted by alphatango View Post
        Is there a way to reference the "fromEntrySignal"? I see that in the SetStopLoss and SetProfitTarget. That would be a valuable thing to have stored as a Position note.

        (I can use them for "if" statements; if ("mylongentry") ... else if ("myshortentry"), etc)
        Yes, the FromEnrySignal is a property of the Order object:


        Please let us know if we may be of further assistance.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Yesterday, 05:17 AM
        0 responses
        54 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        130 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        70 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        44 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        49 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X