Announcement

Collapse
No announcement yet.

Price Breakout

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

  • Price Breakout

    I am very new to efs and I am attempting to backtest my trading stragegy that involves the Macd and Stochastics crossing along with the 50 day moving average. So far I have got this to show where all the the actual crossovers take place.

    However, the final part of my stragegy involves the high\low of the relevant bar that crossed, also being broken by any subsequent bars within a specified period of ten bars.

    Is there any way that the high or low value of the bar could be stored in a variable that was then tested by the subsequent bars to indicate a long or short position.

    Thanks in advance for any help out there

  • #2
    Here is how I would remember a value for later use...

    in preMain
    var savedHigh;
    var savedHighFlag=0;

    if(savedHighFlag==0){
    savedHigh= high(0);
    savedHighFlag=1;
    }

    Now you can check to see if the high of the current bar high(0) is > savedHigh

    you must turn savedHighFlag back to 0 at some point or else the next high will not be saved.

    Comment


    • #3
      Thanks for that, It gives something to work on.

      Comment

      Working...
      X