Announcement

Collapse
No announcement yet.

ATR Trailing Stop

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • ATR Trailing Stop

    Hi !

    In the Stocks&Commodities Forum is a great EFS:

    the modified ATR trailing stop.efs



    The problem is that the stop is not updading from alone and i must refresh the chart afer a new period.

    Is there a chance to amend this?

    Thanks
    Last edited by vienna; 05-26-2009, 04:50 AM.

  • #2
    Re: ATR Trailing Stop

    vienna
    As far as I can see that efs is intended for backtesting use and the reason why it does not update in real time is because of the following conditional statement
    if(getCurrentBarIndex() == 0) return;
    which stops the efs from executing once it is processing the most recent bar on the chart (ie bar index 0)
    Even if you were to remove or comment out that line of code you would then need to also revise the trading signals logic which is currently set to evaluate the bar being processed and execute the trades based on the Open of the following bar. While the value of the Open of the following bar is known as the efs processes historical data during a backtest it is not known in real time. In order to resolve this you would need to change all the references to evaluate the bar prior to the one being processed and execute the trade on the bar currently being processed
    Alex


    Originally posted by vienna
    Hi !

    In the Stocks&Commodities Forum is a great EFS:

    the modified ATR trailing stop.efs



    The problem is that the stop is not updading from alone and i must refresh the chart afer a new period.

    Is there a chance to amend this?

    Thanks

    Comment


    • #3
      Hi Alexis !

      Thanks very much for your quick answer as usual !!!!!!

      I put in a "1" instead of the "0" .

      I looks like that the line is now updading. i only need the line not the arrows and signals.

      Thaks

      Vienna

      Comment


      • #4
        Vienna
        You are most welcome

        I put in a "1" instead of the "0" .
        You can also just comment out that whole line
        Alex


        Originally posted by vienna
        Hi Alexis !

        Thanks very much for your quick answer as usual !!!!!!

        I put in a "1" instead of the "0" .

        I looks like that the line is now updading. i only need the line not the arrows and signals.

        Thaks

        Vienna

        Comment

        Working...
        X