Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

if i am in a "long" position and a short signal is activated

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

    #16
    Bertrand,

    How can I use your recommendation if I am going from long straight to short? I suppose to code just "EnterShort();" right? That was your initial recommendation. So, should I use the code that I wrote this morning and include the sample as per your post?

    If not, where would I place

    // Resets the stop loss to the original value when all positions are closed
    if (Position.MarketPosition == MarketPosition.Flat)
    {
    SetStopLoss(CalculationMode.Ticks, stoplossticks);
    }

    Technically speaking I am only momentarily flat but that is suppose to be beyond the human eye and beyond the code if I were using just "EnterShort();"

    Kay Wai
    Last edited by kaywai; 05-27-2011, 08:06 AM. Reason: Replied without thinking!

    Comment


      #17
      Hi Bertrand,

      Did you miss my reply below?

      Regards

      Kay Wai

      Comment


        #18
        Sorry Kay, didnt't see it since you edited the post after I closed the ticket down - there's a very brief flat state still in a reversal strategy, so the code snippet for the reset would trigger still, just keep it for example on top of OnBarUpdate().

        Comment


          #19
          got it. Thanks Bertrand!

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by charlesugo_1, 05-26-2026, 05:03 PM
          0 responses
          57 views
          0 likes
          Last Post charlesugo_1  
          Started by DannyP96, 05-18-2026, 02:38 PM
          1 response
          143 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 05-11-2026, 05:56 AM
          0 responses
          161 views
          0 likes
          Last Post CarlTrading  
          Started by CarlTrading, 05-10-2026, 08:12 PM
          0 responses
          97 views
          0 likes
          Last Post CarlTrading  
          Started by Hwop38, 05-04-2026, 07:02 PM
          0 responses
          276 views
          0 likes
          Last Post Hwop38
          by Hwop38
           
          Working...
          X