Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

stoploss - double

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

    #16
    Bertrand, thanks again for your sample. Referring to the stops I want to ask why the stop1 doesn´t change referring to the variable.It moves one time but then doesn´t move anymore with the variable (=Donchian).

    .........
    else if (Position.MarketPosition == MarketPosition.Short)
    { if (GetCurrentBid(0) < Position.AvgPrice - 60 * TickSize && step1)

    { SetStopLoss("SG1", CalculationMode.Price, stop1, false);
    SetStopLoss("SG2", CalculationMode.Price, Position.AvgPrice, false);
    SetStopLoss("SG3", CalculationMode.Price, Position.AvgPrice, false);
    step1 = false; }

    if (GetCurrentBid(0) < Position.AvgPrice - 90 * TickSize && step1 == false)

    { //SetStopLoss("S1", CalculationMode.Price, stop1, false);
    SetStopLoss("SG2", CalculationMode.Price, stop2, false);
    SetStopLoss("SG3", CalculationMode.Price, stop3, false); }

    also with
    {SetStopLoss("S1", CalculationMode.Price, stop1, false);
    SetStopLoss("SG2", CalculationMode.Price, stop2, false);
    SetStopLoss("SG3", CalculationMode.Price, stop3, false); }

    stop1 is fixed at first stop and doesn´t move further. Why?

    Thanks
    Tony
    Last edited by tonynt; 07-29-2011, 07:15 AM. Reason: clearify

    Comment


      #17
      Tony, in the code you just posted, there is no code for a donchian stop. I would guess that your conditions for changing the stop simply aren't true. Please print out these variables to make sure they have the expected value, and then you can start moving the stops. Also, I would highly recommend you figuring this out with just one position (and stop) and then when that works 100% fine, you can add in the other positions and stops.
      AustinNinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      29 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      117 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 05-10-2026, 08:12 PM
      0 responses
      69 views
      0 likes
      Last Post CarlTrading  
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      227 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      309 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X