Announcement

Collapse
No announcement yet.

Return only last bar value from efs script

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

  • Return only last bar value from efs script

    I am interested to know if I could return a value from only the last bar instead of returning value for each bar on the chart to avoid to much clutter when I use the return function for a study?
    so at the end of my script when I use:

    return mystudy; I get a value returned for each bar on the chart but I would only want for the last value.

    Many thanks,

    Baldur

  • #2
    Hi Baldur,

    It really depends on what you are trying to do as to the effectiveness of this, however, there is a command may help out:

    isLastBarOnChart()

    Returns true if the bar currently being processed is the last bar on the chart.


    What you would do is



    if(isLastBarOnChart()){
    return mystudy;
    }
    else{}


    I haven't tried anything like this with efsInternal() or efsExternal() but I suspect this may cause some problems if the efs you have applied "isLastBarOnChart()" to being called by these functions.

    Comment

    Working...
    X