Please, Help Me

Discussion in 'Strategy Development' started by duynnh, Feb 9, 2006.

  1. duynnh


    I am a newb to EasyLanguage and have a little problem. I am writing a strategy that uses a longer timeframe as a condition before I go to the shorter timeframe to take trades and exits. I was hoping that someone could help me.

    I am looking for the macd(5,13,6) lines to be a certain amount before running the strategy on the 5 min. Any help would be greatly appreciated.

    If lines on macd 30 min are a positive then
    run 5 min code.

    Thanks a lot.
  2. You will have to plot two datastreams on your chart. Have a look at the code of the spread ratio indicator. Then you will in your strategy have to define " if -condition 1- of data1 then begin If -condition 2- of data2 then ....end; end;"

  3. It seems 'easy' but it's a little complicated for a beginner.

    You need to have the 5 min data on the chart and then you need to insert the 30 min data as well. Format the 30 min data as "hidden", data2. This way you don't see it and it won't clutter up your chart.

    As for the system code...I don't play with MACD but your code will have to reference data2 (the 30min) first in order to issue orders on the 5 min bars (data1) TS *only* issues orders for symbol data1.

    You need to look at how other people integrate "data2" into their code.
  4. danmb280


    the above responses are right on, i just wanted to add that you have to increase your lookback period ( look at format strategies) to accomodate the 30 min chart. I couldnt get my strategies to work because I didnt realize that with multiple data steams (data1 , data2 etc) the largest time frame needs to be accomodated first. So in other words when u use a 20 SMA on a 30 min chart and u use a 5 min chart u need to make sure that the look back period leaves enough room for the strategy to go back 20 bars for the 30 min chart. I hope that helps