Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Setting stop and profit targets at entry bar

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

    Setting stop and profit targets at entry bar

    Hello,
    I am wanting to use MIN of the last 5 bars as a stop loss upon entry into a position. However, as new bars form, MIN changes. Is there a way I can dictate the strategy to set the stop loss based on the MIN(5) of the entry bar? I want the Stop to stay static. Similar to the way an ATM strategy would work while being dynamic to the situation.

    I am currently assigning a stopmode = 0 (user variable) upon entry and dictating that "if stopmode = 0, then set a stop market order at the MIN(5)(Low)"

    Thanks,

    Dave

    #2
    Hello DavidParkins,

    Yes that is possible, you would use a double variable for that to store the MIN at the time of the entry to the variable. Later when submitting a stop you could use the variable price which represents the MIN of the last entry time.

    I look forward to being of further assistance.

    Comment


      #3
      Originally posted by NinjaTrader_Jesse View Post
      Hello DavidParkins,

      Yes that is possible, you would use a double variable for that to store the MIN at the time of the entry to the variable. Later when submitting a stop you could use the variable price which represents the MIN of the last entry time.

      I look forward to being of further assistance.
      I feel silly, but Im lost here. Im not sure how to save the time of my entry with the MIN.

      Ill explain what I have so far.
      Set1 = If 'Entry Conditions' are met, do the following >>> EnterLong, StopMode(User Variable (Int)) = 0

      Set2 = If Position.Market Position = MarketPosition.Long and StopMode = 0, do the following >>> ExitLongStopMarket(DefaultQuantity, MIN(Low,5)[0],"","");

      Set3 = Similar to step 2 but will be a take profit.

      I Tried MIN(low,5)[1] and got the same result basically.

      Thanks,
      Dave

      Comment


        #4
        Hello DavidParkins,

        To set the min to a variable so it can be used later you would need to do that from set 1 with the entry.

        In the Inputs and Variables screen make a double variable named myMin.

        In set 1's actions add a new action of -> Misc -> Set myMin

        Hover the mouse over the value and click Set

        Select Indicators -> Min and configure it as needed

        When your entry is submitted the MIN will be saved from that point in time.

        In set 2 where you have used MIN(Low... you would instead use myMin variable as the price.


        I look forward to being of further assistance.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        56 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 05-10-2026, 08:12 PM
        0 responses
        33 views
        0 likes
        Last Post CarlTrading  
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        195 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Started by CaptainJack, 04-24-2026, 11:07 PM
        0 responses
        359 views
        0 likes
        Last Post CaptainJack  
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        280 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Working...
        X