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 NullPointStrategies, Yesterday, 05:17 AM
            0 responses
            55 views
            0 likes
            Last Post NullPointStrategies  
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            132 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            73 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            45 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            49 views
            0 likes
            Last Post TheRealMorford  
            Working...
            X