Announcement

Collapse
No announcement yet.

Does EFS logic know what happened within a bar?

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

  • Does EFS logic know what happened within a bar?

    Hi, I cant find the answer to this. Does anyone know when you are coding in efs if it can distinguish what price action was within a bar?

    For example, I am looking at a bollinger band study on a 15 minute chart and the price intersects both the middle and lower band. Is there anyway(other than changing the timeframe) to know which band was intersected by the price first?

    Thanks for any help

  • #2
    Remove this function call from your preMain():

    setComputeOnClose();

    If that's not there then check to see if any of the code is wrapped with an if() condition like this:

    if (getBarState() == BARSTATE_NEWBAR)
    {
    ...
    }

    That code only executes on the first tick of each new bar.

    Comment


    • #3
      Thanks for replying.... I don't have any code like that in my script.

      I have the basic bollinger band script and added to it so it alerts me whenever the price touches the lower band and then comes back up and touches the middle mavg.

      However on large bars that touch both the lower band and the middle mavg it is giving an alert, which is fine if it hit the lower band FIRST and then comes back to the mavg, but not if it is touching the middle mavg first then the lower band.

      So is there any way that efs code can know whether it hit the lower band first or the mavg first when the price hits both within the same bar?

      Comment


      • #4
        try:
        1- Right click on a blank space in the 15 min chart and select "Insert Symbol"
        2- Change the interval to 5 min (or 2 min or whatever works best) leaving all checkboxes unchecked, then click insert followed by close.
        The new bars should ploted as a new substudy under the main chart.
        3- Right click on one of the newly plotted 5 min bars and select "Insert Study Over Series", select the study and edit alerts as necessary. The BB study you add should have the option to modify the interval so that it can be set to 15 minutes when applied to the 5 min bars.

        This should now alert as you intend. Note that the spacing of the main chart will be greater than usual to accomodate the additional 5 min bars per each 15 min bar.

        Wayne
        Last edited by waynecd; 10-08-2013, 09:19 PM.

        Comment

        Working...
        X