Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Looking up Global lines from another Chart`in a strategy

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

    Looking up Global lines from another Chart`in a strategy

    My strategy looks up lines as follows:

    IDrawObject drawing_object = DrawObjects[lineTag];
    if (drawing_object !=null && drawing_object.DrawType == DrawType.Line) {
    ....
    }

    If the line is drawn on the chart on which the Strategy is running, everything is fine. However I am tying to lookup a line drawn on another time frame chart of same instrument using global tags (starting with @) and can't seem to locate the line.

    Also, lines with Global tags don't seem to show up on my other charts of same instrument either.

    Is looking up global lines from another chart of same instrument expected to work?

    #2
    Hello higher.high,

    Thank you for your post.

    Are you talking about Global Drawing Objects? If so, right click in your chart > select Data Series > is Show Global Draw Objects set to True or False? Mine is set to True and when I add the followign code to an indicator on my 1 minute chart, a drawing object that is global and drawn on my 30 minute chart is printed to the output window.
    Code:
    			foreach(IDrawObject draw in DrawObjects)
    			{
    				if(draw.DrawType == DrawType.Line)
    				{
    					Print(draw.ToString());
    				}
    			}

    Comment


      #3
      Yes I do have that property checked.

      I have two charts ES 60 Min, ES 10k Vol. I have two global lines, one on 60 min chart @ES60 and one on ES 10k Chart @SES10K. I have a strategy with same code as above on my 60 min chart, it only shows the one line from 60 min chart, not the one from 10k chart. Attached SS of ES 60, ES 10k and Output window.






      So line drawn on same chart shows, not from another chart of same instrument even with tag starting with "@".

      Following is the same strategy code copied from the thread:

      foreach(IDrawObject draw in DrawObjects)
      {
      if(draw.DrawType == DrawType.Line)
      {
      Print("Tag = " + draw.Tag + ", Line = " + draw.ToString());
      }
      }
      Thanks.
      Last edited by higher.high; 05-17-2015, 12:14 PM.

      Comment


        #4
        Hello,

        Thank you for the question.

        For what you are trying to do, there is no supported method to do this through script. The collection of drawing objects you are getting would be from the chart the script is running on, not a Global collection of all objects.

        Unfortunately there is no global collection of objects to access so I am unsure of a way for you to access two charts objects from one script on a single chart. Even though the object is set to global, it is not directly Added to the chart to become part of its collection in this situation, it is only being drawn on any chart that is also that instrument but still remains in the original charts collection.

        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by FrancisMorro, Today, 03:24 AM
        0 responses
        1 view
        0 likes
        Last Post FrancisMorro  
        Started by Segwin, 05-07-2018, 02:15 PM
        10 responses
        1,769 views
        0 likes
        Last Post Leafcutter  
        Started by Rapine Heihei, 04-23-2024, 07:51 PM
        2 responses
        30 views
        0 likes
        Last Post Max238
        by Max238
         
        Started by Shansen, 08-30-2019, 10:18 PM
        24 responses
        943 views
        0 likes
        Last Post spwizard  
        Started by Max238, Today, 01:28 AM
        0 responses
        10 views
        0 likes
        Last Post Max238
        by Max238
         
        Working...
        X