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 argusthome, 03-08-2026, 10:06 AM
      0 responses
      71 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      43 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      25 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      28 views
      0 likes
      Last Post TheRealMorford  
      Started by Mindset, 02-28-2026, 06:16 AM
      0 responses
      56 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X