Announcement

Collapse
No announcement yet.

Refreshing Chart

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

  • Refreshing Chart

    Hi an good morning everybody

    I wrote my own EFS, wich will show me buy/sell triggers by a shape, directly in the chart window. If I start eSignal and the chart will be loaded, every thing works fine (all the triggers will be painted). In the running mode over the day, somtetimes it shows me the new trigger an in most cases, -unfortunately not!
    I don't what happend and I can't find the fault.

    Could you help me?
    For better understanding I send you the origin code.

    Greatings
    Markus

    PS: Try the the EFS with am future, like ZB!!!
    Attached Files

  • #2
    Markus
    There are a few major flaws in the script that I can see.
    In line 24 you create a moving average (emaNormalDelay) that is offset backwards by 2 periods which means that there will be no values for this average on the current and prior bar. However in lines 78 and 79 you create two variables (emaLine0 and emaLine1) to which you assign the value of that moving average at the current and prior bar. This means that on historical data the strategy works because it is looking at the future but in real time those values are null.
    Also in line 85 you use close(1) ie the close at the next bar. Again this works on historical data ie you are looking at the future but in real time that value does not exist.
    Another problem I see albeit of a different nature is in lines 90-91 and 103-104. In lines 90-91 you exit the trade if the Low crosses the stop however in the strategy command you use the Open of the same bar as the exit price. The same (but using the High) occurrs in lines 103-104. IMHO both are unrealistic as you would not be able to exit at that price if the stops were hit unless the open gapped below/above the stop line.
    FWIW since you are displacing one of the averages backwards by -2 periods you can obtain the same logical result with this strategy - without the intrinsic flaws of looking into the future - by resetting to 0 the offset on that average and displacing the other average forward (ie using a positive number) by an offset of 2.
    Anyhow you need to review the logic behind the strategy because as it is written now it is forward looking and unrealistic.
    Alex

    Comment


    • #3
      Markus
      Once you resolve the issues described in my prior reply another problem you may run into is that the signals are triggered intrabar. This may cause the strategy to generate false signals which once you refresh the chart or reload the efs will disappear.
      To resolve this you may either want to use setComputeOnClose() or enclose the logic that generates the signals in a BARSTATE_NEWBAR statement
      Hope this helps
      Alex

      Comment

      Working...
      X