Announcement

Collapse
No announcement yet.

signals on efs

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

  • signals on efs

    Hi i am new to esignal systems. I set up a program (buy/sell1efs) watching it live i am confused how it gives the signals.. a red arrow and sell appears then a green and a buy but these seem to dissappear then re appear.. finally ending up with one remaining ..how can a person know which signal is really the one to trade?

  • #2
    Re: signals on efs

    Hello larry384,

    Originally posted by larry384
    Hi i am new to esignal systems. I set up a program (buy/sell1efs) watching it live i am confused how it gives the signals.. a red arrow and sell appears then a green and a buy but these seem to dissappear then re appear.. finally ending up with one remaining ..how can a person know which signal is really the one to trade?
    The problem you're describing is a common pitfall in EFS formula development. The real answer to your question is that the formula code needs some additional logic to prevent the conditions from being evaluated multiple times during the interval. The formula currently is evaluating signals on the current bar on a trade-by-trade basis. Therefore, depending on the price of each trade, the trade condition could evaluate to true at one level, false at another, and back and forth until the interval closes. These are referred to as false signals, which creates this disappear/reappear behavior.

    Here are a few options for you to consider.

    1) If you want to evaluate the signals intrabar and take only the first one, then you could incorporate some code logic to control this. For a code example of this type of logic, please see AlertOncePerBar.efs.

    2) If you want to evaluate the signals on completed bars only, then add a BARSTATE_NEWBAR condition with getBarState() to your code and move your signals inside this condition. Then evaluate the signals on the data from bar -1, which is the previous bar. The BARSTATE_NEWBAR condition will be true at the open of each bar and only occurs once per bar as well.

    PHP Code:
    function main() {
        if (
    getBarState() == BARSTATE_NEWBAR) {
            
    // your trade conditions here
        
    }

        return;

    3) Add setComputeOnClose() to preMain(). This function forces the EFS to only process once per bar as each bar closes.
    Jason K.
    Project Manager
    eSignal - an Interactive Data company

    EFS KnowledgeBase
    JavaScript for EFS Video Series
    EFS Beginner Tutorial Series
    EFS Glossary
    Custom EFS Development Policy

    New User Orientation

    Comment


    • #3
      Jason,

      I'm looking for a buy/sell signal. I can't seem to find it on any of the indictaors or formulas. Can you advise?

      Thanks and Best Regards,

      Nick Mastrandrea

      Comment


      • #4
        Originally posted by nmastran
        Jason,

        I'm looking for a buy/sell signal. I can't seem to find it on any of the indictaors or formulas. Can you advise?

        Thanks and Best Regards,

        Nick Mastrandrea
        Nick,

        There are two types of EFS Studies, indicator and Strategy.

        Most of the studies that are posted particularily in this, the "EFS Studies" forum are indicator studies which don't usually contain buy/sell signals.

        A strategy EFS for the purpose of backtesting will include buy and sell signals in the form of calls to the Strategy Object's (or "backtester" ) methods in the form of EFS statements such as: "Strategy.doLong, Strategy.doShort" etc.

        The problem you described was specific to the EFS you were trying to run for which Jason gave you several comprehensive solutions that will correct the problem you were experiencing even though the code was not provided.

        In the future if you post the code or working portion Jason and others will be able to assist you further.


        Glen
        Glen Demarco
        [email protected]

        Comment


        • #5
          Hello Nick,

          Please try a search using the "buysell.efs" for the keyword. You should find several threads.
          Jason K.
          Project Manager
          eSignal - an Interactive Data company

          EFS KnowledgeBase
          JavaScript for EFS Video Series
          EFS Beginner Tutorial Series
          EFS Glossary
          Custom EFS Development Policy

          New User Orientation

          Comment

          Working...
          X