Announcement

Collapse
No announcement yet.

Based On Time?

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

  • Based On Time?

    I was investing if its possible using EFS programming to code an indicator that would for instance look at the system clock and only execute trading decisions based on time?

    I am starting to just look into this idea, and wanted to consult with the ones that know if this is possible.

    So for instance say the indicator is programmed to enter a trade based on criteria that is programmed. but I only want this indicator to be ran say every 30 minutes / 20 minutes, etc.
    if the conditions aren't met, then it does nothing, and waits for the next 20 minutes, etc. etc.

    Is this possible to do with Esignal?

    and if so are there any documentation that can be read about this function of the EFS language?

  • #2
    This is easy.

    All you're basically doing is taking 2 timestamps and comparing them against a duration you're waiting for before you make a trading decision.

    Use "new Date().getTime()" to get a timestamp in milliseconds and convert whatever duration you're waiting for to milliseconds and you're good to go.

    If you're still having problems, post the code and I'll correct it for you.

    You have to do this in a script that does not have a call to setComputeOnClose() in the preMain() function.

    Plus, you'll want to do this check embedded in the following if statement:

    if (isLastBarOnChart())
    {
    }

    You have to skip over historical data being loaded into your chart.
    Last edited by SteveH; 04-08-2011, 06:48 AM.

    Comment

    Working...
    X