Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

stops with variable distance

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

    stops with variable distance

    Hello,

    my stops do not work as they should. I try to have them "variable" and not with fixed distance in ticks.

    When I try to use

    a.) the low of the current bar and the bar before it doesnt work
    ctlow1=Low [0] - (3*TickSize);
    ctlow2=Low [1] - (3*TickSize);
    SetStopLoss("kLa", CalculationMode.Price, Math.Min(ctlow1,ctlow2), false);

    b.) and also when I change eg to Donchian3 it doesnt work
    stop1=DonchianChannel(3).Lower[1]-3*TickSize;
    SetStopLoss("kLb", CalculationMode.Price, stop1, false);

    What I´m doin wrong?

    Thank you.
    Tony

    #2
    Tony,

    Where in the script are you changing these values?

    Can you provide the script that you are using so I can review this further?
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      Hello,

      thank you for your reply. I do in onbarupdate the following snippets and testing and testing. But the stop is not accurate where it should be. Sometimes its 3 TicksBelow the Low, sometimes its at the low....

      #region Trade Management Logic - Stops

      //entrypriceLong=GetAtmStrategyPositionAveragePrice( atmStrategyId);
      stop1=DonchianChannel(3).Lower[1]-3*TickSize;
      ctlow1=Low [0] - (3*TickSize);
      ctlow2=Low [1] - (3*TickSize);
      ctlow3=MIN(Low, 3)[0] - (3*TickSize);
      stop1=DonchianChannel(3).Lower[1]-3*TickSize;

      if (Position.MarketPosition == MarketPosition.Flat)
      {

      SetStopLoss("kLa", CalculationMode.Price, Math.Min(ctlow1,ctlow2), false);
      SetStopLoss("kLb", CalculationMode.Price, ctlow3, false);
      SetStopLoss("kLc", CalculationMode.Price, stop1, false);

      Thank you.
      Tony





      Originally posted by NinjaTrader_Cal View Post
      Tony,

      Where in the script are you changing these values?

      Can you provide the script that you are using so I can review this further?

      Comment


        #4
        Tony,

        I don't quite follow along, could you please provide more information as below?

        Where and when are you seeing the Stop not get adjusted when you run this strategy?

        Where else are you setting these orders with the prices?

        I'm assuming that you are modifying the price somewhere else and then resetting it back.
        Last edited by NinjaTrader_CalH; 10-14-2014, 10:42 AM.
        Cal H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Kaledus, Today, 01:29 PM
        5 responses
        12 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by Waxavi, Today, 02:00 AM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_LuisH  
        Started by alifarahani, Today, 09:40 AM
        5 responses
        23 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by gentlebenthebear, Today, 01:30 AM
        3 responses
        16 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by PhillT, Today, 02:16 PM
        2 responses
        7 views
        0 likes
        Last Post PhillT
        by PhillT
         
        Working...
        X