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 chbruno, Today, 04:10 PM
        0 responses
        3 views
        0 likes
        Last Post chbruno
        by chbruno
         
        Started by josh18955, 03-25-2023, 11:16 AM
        6 responses
        436 views
        0 likes
        Last Post Delerium  
        Started by FAQtrader, Today, 03:35 PM
        0 responses
        6 views
        0 likes
        Last Post FAQtrader  
        Started by rocketman7, Today, 09:41 AM
        5 responses
        19 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by frslvr, 04-11-2024, 07:26 AM
        9 responses
        127 views
        1 like
        Last Post caryc123  
        Working...
        X