Announcement

Collapse
No announcement yet.

efs Optimization

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

  • efs Optimization

    I have a study with several symbols being displayed. I only need the last couple of symbols to be displayed on the charts. Can this be done with a count function. Any sample code would be great.

  • #2
    symbols??

    do you mean SHAPES/LINES?? If so, yes - this can be done easily.

    here is an example from my friend Steve (posted earlier)

    PHP Code:
    //outside MAIN

    var yourcounter 0;

    //before your graphics statements 
    if (getBarState() == BARSTATE_NEWBAR) { 
      if (
    varcounter 50)
        
    varcounter =0;
      else 
    varcounter++;

      
    //your graphics statements - just an example, they can be text, symbols, whatever, this is how you control the total number on the chart, to minimize performance issues

      
    drawLineRelativex1y1x2y2stylethicknesscolor ,"each"+varcounter ); //first line
      
    drawLineRelativex1y1x2y2stylethicknesscolor ,"is"+varcounter ); //second unique line
      
    drawLineRelativex1y1x2y2stylethicknesscolor ,"a"+varcounter );//third unique line 
      
    drawLineRelativex1y1x2y2stylethicknesscolor ,"different"+varcounter );//fourth unique line 
      
    drawLineRelativex1y1x2y2stylethicknesscolor ,"line"+varcounter ); //fifth unique line
      
    drawLineRelativex1y1x2y2stylethicknesscolor ,"every"+varcounter ); //sixth unique line
      
    drawLineRelativex1y1x2y2stylethicknesscolor ,"bar"+varcounter ); //seventh unique line

    Brad Matheny
    eSignal Solution Provider since 2000

    Comment


    • #3
      shapecounter

      Brad,


      this is what I have so far

      Function sell(){

      if (getBarState() == BARSTATE_NEWBAR) {
      if (getBarState() == BARSTATE_NEWBAR) {
      if (shapecounter > 5)
      shapecounter =0;
      else shapecounter++;
      }

      drawShapeRelative(0,high()+.1.shape.DOWNARROW,"", Color.red,+shapecounter);

      my main looks like

      main()

      shapecounter ++;

      and of course I have

      var shapecounter = 0;


      above the function preMain();
      Like I said earlier my goal in this is to only display the last five shapes on the chart to conserve cpu load.

      Comment

      Working...
      X