Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

overridding managed targerts and stops

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

    overridding managed targerts and stops

    Can you over ride a target and stop in a strategy. I have a double click function set in my strategy and when I double click I then want to move my stops and targets accordingly


    //My Entry *******************************************
    if(Position.MarketPosition == MarketPosition.Flat)
    {


    if(nTarget1Contracts != 0 && bManualStopMovement ==false )
    {

    SetProfitTarget("Short1",CalculationMode.Price,dAT R1,true);
    SetStopLoss("Short1",CalculationMode.Price,dATR8,f alse);
    if(bUseMar****rder == true)
    EnterShort(nTarget1Contracts,"Short1");
    else
    EnterShortLimit(0, true,nTarget1Contracts,dATR7,"Short1");
    }
    }





    protected void MouseClicked(object sender, MouseButtonEventArgs e)
    {


    if (e.ClickCount == 2)
    {

    bManualStopMovement = true;


    }


    }

    #2
    Hello ballboy11,

    If you mean to change the orders to a new price, yes you can do that. You would need to call the Set method again with a new price and the same Signal name/From EntrySignal name. In a button handler you won't have direct access to NinjaScript properties, so you would additionally need to surround this code with TriggerCustomEvent:

    Code:
    TriggerCustomEvent((o)=>{
    // put your code here
    }, null);


    Please let me know if I may be of additional assistance,

    Comment


      #3
      In order to do that would drag the Targetr order then Click the mouse with the Letter A held down for example?

      ie mouse click with Letter a down

      SetProfitTarget("name"

      Comment


        #4
        Hello ballboy11,

        I am not certain I understand what you have asked, are you asking if you can use keyboard modifier keys?

        Keyboard and mouse handling are not something which is native to Indicators or Strategies however you can use C# events which you already are. You can do most items which the standard C# events can do such as use modifier keys if you wanted to, however, this would not be something I could detail or provide samples for.

        I look forward to being of further assistance.

        Comment


          #5
          So compared to a manual ATM strategy with targets and stops that one can move freely vs a strategy can one find the active stops and targets objects

          Comment


            #6
            Hello ballboy11,

            I am sorry but I am not understanding what you are asking the way you have asked the question. Are you specifically asking if you can find the orders that your strategy is producing?
            can one find the active stops and targets objects
            Yes, you can locate orders your strategy has produced by using the OnOrderUpdate or OnExecutionUpdate overrides, is this what you are asking? I see you have another post where you have used an Order object for the entry, this would be the same concept to locate your stops. We have a sample of monitoring the targets here: https://ninjatrader.com/support/help..._and_profi.htm

            I look forward to being of further assistance.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Mindset, 04-21-2026, 06:46 AM
            0 responses
            88 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by M4ndoo, 04-20-2026, 05:21 PM
            0 responses
            134 views
            0 likes
            Last Post M4ndoo
            by M4ndoo
             
            Started by M4ndoo, 04-19-2026, 05:54 PM
            0 responses
            68 views
            0 likes
            Last Post M4ndoo
            by M4ndoo
             
            Started by cmoran13, 04-16-2026, 01:02 PM
            0 responses
            119 views
            0 likes
            Last Post cmoran13  
            Started by PaulMohn, 04-10-2026, 11:11 AM
            0 responses
            67 views
            0 likes
            Last Post PaulMohn  
            Working...
            X