Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to trail with points using variable?

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

    How to trail with points using variable?

    Very basic strategy.
    As soon as I enter, I have a trailing stop variable that saves average price - stop loss points (30) and a stop order with same condition.
    On next set, I have a condition that checks price is average price + take profit 1 (30) and set the trailing stop variable to current price - stop loss points.
    Now, it trails it but it goes up and down 30 points with the price.
    If price is at 18000, stop is at 17970. When price goes down to 17970, stop trails down to 17940 instead of stopping at 17970.
    Basically, right now, it never hits stop as price never hits price - 30.
    How do I make it a trail stop and not go down from the highest trailing stop price?
    Thanks
    Last edited by Mystery; 04-26-2025, 11:24 PM.

    #2
    Hello Mystery,

    From the description it sounds like the condition calling the order method is remaining true. Have you used a Print statement in the condition to see when it is true or for which bars it is true?

    Comment


      #3
      Originally posted by NinjaTrader_Jesse View Post
      Hello Mystery,

      From the description it sounds like the condition calling the order method is remaining true. Have you used a Print statement in the condition to see when it is true or for which bars it is true?
      I have no idea how to do that. Just tried Ninja trader recently.
      I'll look for that online.
      All I'm trying to do is automate ATM trailing that we can do manually.
      Also, I'm not using Ninja script editor. I'm using the strategy builder.
      Is there something in strategy builder to trail stop loss by points?
      Last edited by Mystery; 04-29-2025, 08:41 PM.

      Comment


        #4
        Hello Mystery,

        To debug your strategy using the builder you can still use prints, the following video goes over how to do that.



        You can make trailing orders in the builder, the easiest way is to use the stops and targets page. The builder has no option to use Points but you can use an offset of TIcks, you would need to convert the points to ticks and then use that value as the offset. You can also create targets in the condition builder, the area with Set1, in that area you would have to use a variable for the price which does not change so when you call the order it stays in place.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Today, 05:17 AM
        0 responses
        38 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        124 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        64 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        41 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        46 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X