Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

debugging, drawing, dataseries

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

    debugging, drawing, dataseries

    Hello,

    I thought its an easy solution to debug script-strategies by using drawingobjects when conditions true. This works fine but when I add in my script-strategies dataseries and conditions are true from added dataseries it doesn´t plot always. I assume it does plot only when the primary dataseries coincides with the added ones?

    What could one do for drawing or plotting on the chart when conditions true from added dataseries to have the drawingobject on the chart, or any other solution to control all the time if conditions from the script-strategy (in all dataseries) are true or false (except output window, this is not to catch with all the messages there)

    Eg chart is a 3 Range and a condition is true in a 1 minute chart or a 2 Range chart.

    Thank you
    Tony
    Last edited by tonynt; 11-03-2016, 09:41 AM. Reason: Translation error. clearifying

    #2
    Hello tonyt, and thank you for your query.

    So we can have a more complete picture as far as our goals with drawing objects, could you attach a stripped down copy of your strategy in progress to a reply here? You can find your strategies in (My) Documents\NinjaTrader 8\bin\Custom\Strategies
    Jessica P.NinjaTrader Customer Service

    Comment


      #3
      Hello Jessica,

      thank you for your reply. Please find attached a minimized sample. This makes no sense from the logic, its only to show what I mean. When you enable it on a 5 min chart then you can see that the backcoloring or the drawtext is not always there when the condition is true in the Range Chart. What might be a solution? When drawtextfixed on the chart would work to give the values, then one does not see easily and at time which bar.

      Thank you for your support!
      Tony
      Attached Files

      Comment


        #4
        Hello tonyt,

        I am attaching a copy of your strategy's output on my end so that it is easier to discuss how I can help. The image seemed to be performing perfectly in accord with the code you wrote. Would it be possible for you to edit the attached image in your favorite image editor (you can bring one up by pressing the windows key to the left of the space bar and the letter r simultaneously, then typing mspaint into the window that comes up and hitting enter) and circle the parts that are not performing the way we would expect? Thank you in advance, this will make it easier to advise further.
        Attached Files
        Jessica P.NinjaTrader Customer Service

        Comment


          #5
          Hello Jessica,

          thank you for your reply. I think this KR is not the best example. And it seems to plot really OK with this KR condition. I try to show it with another code and then I send to you again a screenshot.

          Thank you for your support!
          Tony

          Comment


            #6
            Hello Jessica,

            I think my problem here is the dataseries access. Please let me ask: when I use primary dataseries and 3 added dataseries in the script-strategy, is it OK to have in onbarupdate:

            if(CurrentBars[0]<1 || CurrentBars[1]<1 ||CurrentBars[2]<1 || CurrentBars[3]<1) return;
            or do I have to write
            if (BarsInProgress!=0 || CurrentBars[0]<1 || CurrentBars[1]<1 ||CurrentBars[2]<1
            || CurrentBars[3]<1) return;

            PLEASE don´t send me the link for learning the BarsArray, I still have the problem to understand how to start the onbarupdate when using indicators in the coding with 3 dataseries. Is it necessary to have also "if BIP!=0"? Because when I remove it and have only CurrentBars the drawings are OK, but I dont know if this might then cause problems in the other conditions.

            Thank you!
            Tony
            Last edited by tonynt; 11-03-2016, 02:23 PM. Reason: clearifying, translation error

            Comment


              #7
              Both those forms are okay. With the first one, it will call OnBarUpdate in every one of your data series. With the second, it will only call it on your first data series' bars.
              Jessica P.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by rdtdale, Yesterday, 01:02 PM
              2 responses
              15 views
              0 likes
              Last Post rdtdale
              by rdtdale
               
              Started by TradeSaber, Today, 07:18 AM
              0 responses
              7 views
              0 likes
              Last Post TradeSaber  
              Started by PaulMohn, Today, 05:00 AM
              0 responses
              10 views
              0 likes
              Last Post PaulMohn  
              Started by ZenCortexAuCost, Today, 04:24 AM
              0 responses
              6 views
              0 likes
              Last Post ZenCortexAuCost  
              Started by ZenCortexAuCost, Today, 04:22 AM
              0 responses
              3 views
              0 likes
              Last Post ZenCortexAuCost  
              Working...
              X