• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Input value

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

    #16
    Hello tonynt,

    How does the example above show how to use the properties?
    It provides a full sample including one of the properties being used, you can use the properties listed on that page in the same way as shown in the sample. I am not certain I could explain this any differently, this is the same concept used throughout the samples in the help guide. When an object has properties it would be listed how you see it in this sample describing each property that can be used and likely one sample including one property being used.

    eg like "Draw.HorizontalLine(NinjaScriptBaseowner,stringta g,boolisAutoScale,doubley,Brushbrush,DashStyleHelp erdashStyle,intwidth)" ?
    This is an overload pattern not a property. This is how you initially draw an object and supply the initial parameters it requires. As noted previously there is no overload pattern that includes IsLocked so you need to use the objects properties which brings us back to the help guide sample we are talking about.

    What might be the reason for this "jump-behavior" in CL please?
    I couldn't really say without trying a sample of that code myself, are you also setting the line from OnBarUpdate while trying to move it manually?

    The script has control over the line so any manual adjustments you make will be lost as soon as OnBarUpdate calls this syntax again with the same tag name. If you are also calling the Draw. syntax at the same time you are moving it, that would likely produce strange results.


    Please let me know if I may be of additional assistance.
    JesseNinjaTrader Customer Service

    Comment


      #17
      Hello,

      thank you for your reply. The script has no control over the line as this is disabled from the bool. And there is no issue in ES, NQ.... but in CL one can not move the line as with other instruments because the line jumps somewhere else (same script of course)
      if(linedraw==false)
      {if((Closes[1][0]>Lows[1][0] || Closes[1][0]<Highs[1][0]) && linedraw==false)
      {TxLine = Draw.HorizontalLine(this, "TxLine", true, Closes[1][0], Brushes.Blue, DashStyleHelper.Dash,2);linedraw=true;
      TxLine.IsLocked=false;}}
      if(linedraw==true)
      {if (DrawObjects["TxLine"] != null && DrawObjects["TxLine"] is DrawingTools.HorizontalLine)
      {double linePrice = Instrument.MasterInstrument.RoundToTickSize(TxLine .StartAnchor.Price);linevalue = linePrice;}}

      // linedraw is true as I see in my control drawings, please see attached screenshot

      Thank you!
      Tony
      Attached Files
      Last edited by tonynt; 07-30-2019, 09:35 AM. Reason: add screenshot

      Comment


        #18
        Hello

        The script has no control over the line as this is disabled from the bool.
        That is not how the IsLocked works, this just unlocks the object. Your script is drawing the object so it still controls it. If you call the syntax after you moved the object, it will move back to where it is programmed to be.

        If the object is moving unexpectedly while you are manually moving it, are you certain that is not just your logic calling the Draw method again?

        Please let me know if I may be of further assistance.

        JesseNinjaTrader Customer Service

        Comment


          #19
          Hello,

          It looks like you had edited the post while I replied again so the information no longer matches. I will ensure to leave a longer time before replying in the future to allow your edits.

          If the line is not behaving as you are expecting this is something you need to debug. From the code snippet I cannot tell what may be happening, I would suggest adding prints to where you call the drawing object to make sure that is not being called unexpectedly.

          Please let me know if I may be of further assistance.
          JesseNinjaTrader Customer Service

          Comment


            #20
            Hello Jesse,

            attached is a video where you can see the behavior in CL. You can see its the same script, you can see in the chart the bool is set, you can see the line can be moved accurately in NQ and you can see that in CL the line jumps to somewhere. Above are posted the few lines of the code. There´s nothing more to debug after all.

            https://www.screencast.com/t/4vh5uvX0

            Thank you!
            Tony
            Last edited by tonynt; 07-30-2019, 10:19 AM. Reason: add link

            Comment


              #21
              Hello.

              I can see from the video what you are describing however this does not help to answer the question on why that's happening. Are you certain that your code is not being called to redraw the object while you are dragging it? The video and code snippet so far don't allow me to confirm that is not happening, I can only take your word for it. I still suggest adding prints to confirm that.

              I also see you have other items applied to the chart, are you seeing the same happen on a completely empty chart with no other modifications? It looks like you have the chart linked as well, please try a more simple test which includes only the strategy on a single data series. It looks like in your code you are using multiple series as well, I can suggest to make a more simple test to debug the situation further.

              Please let me know if I may be of further assistance.
              JesseNinjaTrader Customer Service

              Comment


                #22
                Hello,

                after debugging for hours I did now the "1st step"!!! I opened a new chart for CL and there it is working OK, same as with ES, NQ.....

                So it would be interesting why the moving of a drawing object does not work correctly depending of some changes in chart properties (or maybe dataseries). I had only one indicator (orderflow delta) on that CL chart which I removed as well. After I attached the template of a new chart (new chart saved as template "CL_Test") it worked also on that chart window where there have been the issues before. If you would be interested about this - and this is out of my scope - you can visit me with teamviewer if you want to see on the workspace where it occurs.

                Best regards
                Tony
                Last edited by tonynt; 07-30-2019, 02:13 PM. Reason: add info

                Comment


                  #23
                  Hello,

                  If you had not noted what specifically you changed that caused the result to change I don't believe we would want to do any further investigation there, it sounds like that solved the problem. If you otherwise find a specific configuration which causes that effect for drawing objects in general we can report it.

                  Please let me know if I may be of further assistance.
                  JesseNinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by StealthM93, Today, 07:58 PM
                  0 responses
                  2 views
                  0 likes
                  Last Post StealthM93  
                  Started by Mykro, Today, 11:01 AM
                  1 response
                  5 views
                  0 likes
                  Last Post NinjaTrader_ChelseaB  
                  Started by bauerjj10, Today, 12:24 PM
                  1 response
                  12 views
                  0 likes
                  Last Post NinjaTrader_ChelseaB  
                  Started by Newtrader101, Today, 06:01 PM
                  1 response
                  6 views
                  0 likes
                  Last Post NinjaTrader_EricB  
                  Started by Steve L, Today, 03:50 PM
                  1 response
                  9 views
                  0 likes
                  Last Post NinjaTrader_ChelseaB  
                  Working...
                  X