Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

delete condition

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

    delete condition

    Hello,

    I want to ask please how on can delete a condition by another condition in NT-script. I couldnt find it in the video library.

    For Example there is

    if (GetCurrentAsk(0) > Position.AvgPrice +10 * TickSize)
    ExitLongt(2000);

    When a certain condition is true this condition and the exitlong should be deleted (for understanding we expect the market to move stronger in the direction)

    (I do not ask for the other condition of course, only how one can delete.)

    Thanks
    Tony

    #2
    tonynt,

    I am not sure what you mean here. You wish to delete a condition from your code or to exit an order? Could you clarify please?
    Adam P.NinjaTrader Customer Service

    Comment


      #3
      delete condition

      Hello,

      yes, I want to delete a condition from the code. Eg if xMA(xx) crossabove xMA(xx) then "delete" condition (as posted in the question).

      We expect rising prices and therefore the exitlong should not be realized in this case, I want to "let it run" without the target and only with the stoploss. Therefore I want to delete the profit-target-condition in the script (eg by the xma crossover another xma (or anything else - only to explain)

      Thats it.

      Thanks
      Tony



      Originally posted by NinjaTrader_AdamP View Post
      tonynt,

      I am not sure what you mean here. You wish to delete a condition from your code or to exit an order? Could you clarify please?

      Comment


        #4
        Hello tonynt,
        Thanks for the clarification and I am replying for Adam.

        Unfortunately there are no native NinjaScript code to do it. However you can custom code simple C# logic to do it.

        in variable
        Code:
        bool isExit = ture;
        in OnBarUpdate
        Code:
         if (xMA(xx) crossabove xMA(xx))
        {
          isExit = false;
        }
        
        if (isExit && GetCurrentAsk(0) > Position.AvgPrice +10 * TickSize)
        ExitLongt(2000);
        Please let me know if I can assist you any further.
        JoydeepNinjaTrader Customer Service

        Comment


          #5
          Thank you, I´ll try to get it this way. For your information I want to "click away" a certain profit target like

          private void btndeletetarget_Click(object s, EventArgs e)
          {
          ??delete?? ExitLong(1000, "xA","A");
          }

          and I think now it works only with your solution with the variable as I have to cancel the referring conditon. Thank you for the idea.

          Best regards
          Tony



          for
          Originally posted by NinjaTrader_Joydeep View Post
          Hello tonynt,
          Thanks for the clarification and I am replying for Adam.

          Unfortunately there are no native NinjaScript code to do it. However you can custom code simple C# logic to do it.

          in variable
          Code:
          bool isExit = ture;
          in OnBarUpdate
          Code:
           if (xMA(xx) crossabove xMA(xx))
          {
            isExit = false;
          }
          
          if (isExit && GetCurrentAsk(0) > Position.AvgPrice +10 * TickSize)
          ExitLongt(2000);
          Please let me know if I can assist you any further.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Philippe56140, Today, 02:35 PM
          0 responses
          1 view
          0 likes
          Last Post Philippe56140  
          Started by 00nevest, Today, 02:27 PM
          0 responses
          1 view
          0 likes
          Last Post 00nevest  
          Started by Jonafare, 12-06-2012, 03:48 PM
          5 responses
          3,986 views
          0 likes
          Last Post rene69851  
          Started by Fitspressorest, Today, 01:38 PM
          0 responses
          2 views
          0 likes
          Last Post Fitspressorest  
          Started by Jonker, Today, 01:19 PM
          0 responses
          2 views
          0 likes
          Last Post Jonker
          by Jonker
           
          Working...
          X