Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

HUGE! Difference in speed of charting

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

    HUGE! Difference in speed of charting

    Removing all of the DrawLine() calls from my script and converting them to plots with StrategyPlot(0) made a huge difference in charting speed! I wish I had know this sooner.

    //DrawLine("SHORT_COUNT" + CurrentBar, true, 1, SHORT_COUNT_PLOT_POSITIVE_LAST, 0, SHORT_COUNT_PLOT_POSITIVE, Color.Violet, DashStyle.Solid, 1);

    replaced with :

    Add(StrategyPlot(9));
    StrategyPlot(9).Plots[0].Pen.Color = Color.Violet;
    StrategyPlot(9).Plots[0].Pen.DashStyle = DashStyle.Solid;
    StrategyPlot(9).Plots[0].Pen.Width = 1;
    StrategyPlot(9).PanelUI = 1;

    StrategyPlot(9).Value.Set(SHORT_COUNT_PLOT_POSITIV E);

    #2
    DrawLine would be redrawing the line every time you called it.

    the other would only be updating the current position on the chart,

    is this what you are finding?


    Originally posted by darkspeed View Post
    Removing all of the DrawLine() calls from my script and converting them to plots with StrategyPlot(0) made a huge difference in charting speed! I wish I had know this sooner.

    //DrawLine("SHORT_COUNT" + CurrentBar, true, 1, SHORT_COUNT_PLOT_POSITIVE_LAST, 0, SHORT_COUNT_PLOT_POSITIVE, Color.Violet, DashStyle.Solid, 1);

    replaced with :

    Add(StrategyPlot(9));
    StrategyPlot(9).Plots[0].Pen.Color = Color.Violet;
    StrategyPlot(9).Plots[0].Pen.DashStyle = DashStyle.Solid;
    StrategyPlot(9).Plots[0].Pen.Width = 1;
    StrategyPlot(9).PanelUI = 1;

    StrategyPlot(9).Value.Set(SHORT_COUNT_PLOT_POSITIV E);

    Comment


      #3
      Yes.

      I had developed a number of indicators that drew contiguous line segments at times to the price pane. When i would try to scroll left or right i could hear the fans ramp up on my ( quite fast) computer followed by the NT7 going "Not Responding" for a few seconds.

      As an experiment I commented out all lines the called DrawLine() and replaced them with StrategyPlot() and now it just flys when it load and when i need to scroll through a chart bigger than 5000 bars of data (my previous usable limit)

      It will take some getting use to because now my line segments are a continuous plot, but what i did to resolve this is to conditionally change the color of the plot to indicate when an area of the plot should be ignored ( where i would end drawing a line for a period of time )

      I feel stupid i did not find this sooner...

      I already knew that drawing text the price pane would seriously bog down the charts as i had tried to use the text period ( . ) as a smaller version of DrawDot() because the Dot was to large for what i wanted to do.

      There needs to be a streamline list of features to avoid / workarounds to keep everything moving.

      With the added benefit my variables now show up in the data box

      Anyway.. no more lines for me
      Last edited by darkspeed; 05-20-2012, 10:12 AM.

      Comment


        #4
        Originally posted by darkspeed View Post
        Yes.

        I had developed a number of indicators that drew contiguous line segments at times to the price pane. When i would try to scroll left or right i could hear the fans ramp up on my ( quite fast) computer followed by the NT7 going "Not Responding" for a few seconds.

        As an experiment I commented out all lines the called DrawLine() and replaced them with StrategyPlot() and now it just flys when it load and when i need to scroll through a chart bigger than 5000 bars of data (my previous usable limit)

        It will take some getting use to because now my line segments are a continuous plot, but what i did to resolve this is to conditionally change the color of the plot to indicate when an area of the plot should be ignored ( where i would end drawing a line for a period of time )

        I feel stupid i did not find this sooner...

        I already knew that drawing text the price pane would seriously bog down the charts as i had tried to use the text period ( . ) as a smaller version of DrawDot() because the Dot was to large for what i wanted to do.

        There needs to be a streamline list of features to avoid / workarounds to keep everything moving.

        With the added benefit my variables now show up in the data box

        Anyway.. no more lines for me
        Better yet, make the plot color transparent where you do not want to see it.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by frankthearm, Today, 09:08 AM
        3 responses
        6 views
        0 likes
        Last Post NinjaTrader_Clayton  
        Started by yertle, Today, 08:38 AM
        5 responses
        14 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by adeelshahzad, Today, 03:54 AM
        3 responses
        16 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by bill2023, Yesterday, 08:51 AM
        6 responses
        27 views
        0 likes
        Last Post NinjaTrader_Erick  
        Started by NinjaTrader_ChelseaB, 01-08-2017, 06:59 PM
        80 responses
        19,667 views
        5 likes
        Last Post NinjaTrader_ChelseaB  
        Working...
        X