Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

*NT** AtmStrategyChangeStopTarget() method error: OrderName 'STOP1' does not exist

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

    *NT** AtmStrategyChangeStopTarget() method error: OrderName 'STOP1' does not exist

    I created atm from strategy, targets and stops are in fxpro windows,those are lower case.
    Stop1,Target1

    then I try to change those values

    AtmStrategyChangeStopTarget(0, stoplong, "STOP1", atmid);

    its gives me error message *NT** AtmStrategyChangeStopTarget() method error: OrderName 'STOP1' does not exist

    There is Stop1, in fxpro entry window.

    #2
    Hello,

    The atm strategy entry would have need to be done by the NinjaScript strategy in order to be able to modify its stops and targets. Just to verify that the strategy actually placed the trade here.

    Also, it would be a good idea to check and make sure that the ATM Strategy is active. You can do this by checking that atmid.Length() > 0.

    Let me know if I can be of further assistance.

    Comment


      #3
      As I wrote I created from Ninja Strategy, and I also wrote Fxport Shows Stop1, so its allready created and atm create function tell that there is order accepted, and atm strategy is working well its just won'allow me to change values.

      Comment


        #4
        Got it.

        First off your missing a parameter.

        Very strange. everything looks correct. Are you sure you checking the strategy exists before using this?

        If so please send me the strategy to support at ninjatrader dot com and I can take a quick look at it.

        I look forward to assisting you further.

        Comment


          #5
          Cant send it look its making money, and not want distribute, if I can send you NDA then i can send it to you. i don't know why fxpro shows lower case stop names like Stop1.

          if(SuperRule==1)
          {
          atmid=GetAtmStrategyUniqueId();
          orderId = GetAtmStrategyUniqueId();

          TradeEntryBar=CurrentBar;
          Print("Long "+TradeEntryBar.ToString());
          bool aboo=AtmStrategyCreate(OrderAction.Buy, OrderType.Market, 0, 0,TimeInForce.Day, orderId, "EURO",atmid);

          if (aboo==true)
          {

          DrawText("bl"+CurrentBar,"BUY \n at Market \n "+GetCurrentAsk(), 0,L-40*TickSize, Color.DarkGreen);
          DrawArrowUp("MyArrowDown"+CurrentBar,false, 0,L-30*TickSize, Color.Green);
          positionstate=1;
          }

          // Modifying stops if calculated stop better than Constant ATM stop.

          if (aboo==true&&(C-stoplong)<(0.00105))
          {

          AtmStrategyChangeStopTarget(0, stoplong, "STOP1", atmid);
          AtmStrategyChangeStopTarget(0, stoplong, "STOP2", atmid);
          // AtmStrategyChangeStopTarget(0, Low[0] - 3 * TickSize, "STOP1", atmStrategyId);
          Print("STOP CHANGED LOWER VALUE: "+stoplong.ToString());

          }

          }
          Last edited by jokujoku; 01-27-2011, 08:56 AM.

          Comment


            #6
            Missing Parameter ?

            Originally posted by NinjaTrader_Brett View Post
            Got it.

            First off your missing a parameter.

            Very strange. everything looks correct. Are you sure you checking the strategy exists before using this?

            If so please send me the strategy to support at ninjatrader dot com and I can take a quick look at it.

            I look forward to assisting you further.

            Comment


              #7
              Hello,

              Forgot to delete that out. I missed the 0 in your parameter at first. But it looks good.

              The only thing I can think of right now. In your Print statement can you please Print the atmid.

              Since in your code here your not checking if the ATM Strategy is active. This is the only place I can see off hand without running your code on my side to see where the error is. If you print the atmid where your print statement is we want to verify there is in fact an ID there when you call this ChangeOrder method.

              I do not distribute code I get in to take a look at and I agree to a NDA and your strategy wont get distributed.

              Comment


                #8
                I am checking when creating atm if its true.
                offcourse its creting atm strategy i can see from fxpro.
                there is new atm strategy, and stop placed from my template.

                **NT** Submitting order with strategy 'SemiAuto/590651c8175c497eb2df1ca03d8e312a'


                atmid=f199b298fd704453923dfdd1c063c9c6

                thanks
                Originally posted by NinjaTrader_Brett View Post
                Hello,

                Forgot to delete that out. I missed the 0 in your parameter at first. But it looks good.

                The only thing I can think of right now. In your Print statement can you please Print the atmid.

                Since in your code here your not checking if the ATM Strategy is active. This is the only place I can see off hand without running your code on my side to see where the error is. If you print the atmid where your print statement is we want to verify there is in fact an ID there when you call this ChangeOrder method.

                I do not distribute code I get in to take a look at and I agree to a NDA and your strategy wont get distributed.

                Comment


                  #9
                  I am trading forex tenth pips and doing this in reply.

                  Comment


                    #10
                    Hello,

                    Just ran a test on my side and it works on my side.

                    Therefor I would have to run your code on my side.

                    PLease send to support at ninjatrader dot com ATTN: Brett and reference this forum post for me to further look into. As I see nothing off here without being able to run it.

                    Comment


                      #11
                      did you used forex and tent pips, and reply, i will not send my strategy, because thats a logic for creating atm strategy and changing stops. Would you tell me what it can be what can intefer with atm strategy. Any setting/ options.

                      Comment


                        #12
                        Hello,

                        Can't think of anything else off the top of my head that would effect this would need to see the code to further assist. The only thing I can think of is to try it with a different ATM Strategy template. Though you say its executing fine. The difference between the lowercase stop1 and uppercase is not as issue as I did this on my side and it still works.

                        Heres what the next step is.

                        I need you to save a copy of your strategy and stip out all of your secure information you do not want to share. Strip out everything that is in there so just the order entry and stop loss change remains. You can put in some dummy condition for the order entry.

                        Then make sure the problem still exists on this stripped down code and then send this to me so I can look at it.

                        Comment


                          #13
                          How you do it so fast, becaus you have to edit strategy modify my code and also add template.

                          It take long time to setup strategy you have also do atm templates etc.....
                          indicators oh my god, try to figure what in setting options can do wrong

                          Comment


                            #14
                            Hello,

                            I dont need any indicators or anything like that.

                            Just delete everything out execpt for your ATM Strategy Entry and change order code.

                            I can handle the rest from their.

                            Comment


                              #15
                              Put that code inside strategy it wont work for me. also i just made it so i don't have to send my real strategy.


                              protected override void OnBarUpdate()
                              {
                              // Condition set 1
                              if (CrossAbove(Close, SMA(14), 1) == true)
                              {
                              int SuperRule=1;

                              if(SuperRule==1)
                              {
                              string atmid=GetAtmStrategyUniqueId();
                              string orderId = GetAtmStrategyUniqueId();



                              bool aboo=AtmStrategyCreate(OrderAction.Buy, OrderType.Market, 0, 0,TimeInForce.Day, orderId, "EURO",atmid);



                              if (aboo==true)
                              {
                              // jfBuy();
                              // DrawText("bl"+CurrentBar,"BUY \n at Market \n "+GetCurrentAsk(), 0,L-40*TickSize, Color.DarkGreen);
                              // DrawArrowUp("MyArrowDown"+CurrentBar,false, 0,Low[0];-30*TickSize, Color.Green);
                              int positionstate=1;
                              }

                              // Modifying stops if calculated stop better than Constant ATM stop.
                              double stoplong=Close[0]-0.00010;

                              AtmStrategyChangeStopTarget(0, stoplong, "STOP1", atmid);
                              AtmStrategyChangeStopTarget(0, stoplong, "STOP2", atmid);
                              //AtmStrategyChangeStopTarget(0, Low[0] - 3 * TickSize, "STOP1", atmStrategyId);
                              Print("STOP CHANGED LOWER VALUE: "+stoplong.ToString());



                              }





                              }
                              }

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by sidlercom80, 10-28-2023, 08:49 AM
                              172 responses
                              2,279 views
                              0 likes
                              Last Post sidlercom80  
                              Started by Irukandji, Yesterday, 02:53 AM
                              2 responses
                              17 views
                              0 likes
                              Last Post Irukandji  
                              Started by adeelshahzad, Today, 03:54 AM
                              0 responses
                              3 views
                              0 likes
                              Last Post adeelshahzad  
                              Started by CortexZenUSA, Today, 12:53 AM
                              0 responses
                              4 views
                              0 likes
                              Last Post CortexZenUSA  
                              Started by CortexZenUSA, Today, 12:46 AM
                              0 responses
                              2 views
                              0 likes
                              Last Post CortexZenUSA  
                              Working...
                              X