Page 2 of 6 FirstFirst 1234 ... LastLast
Results 11 to 20 of 55
  26 26 Attachment(s)    

Thread: Schaff Trend Cycle EA

  1. #11
    Junior Member
    Join Date
    Jan 2009
    Posts
    25

    Default

    Ok, i understand!



    Thanks!
    K-B

  2. #12
    Junior Member
    Join Date
    Jan 2009
    Posts
    25

    Thumbs up

    Okey.. another problem,

    The EA does multiple trades inside 1 bar, what if i don't want that?
    so, it just waits for the next signal?
    Attached Images Attached Images Schaff Trend Cycle EA-chart2-gif 

  3. #13
    Administrator funyoo's Avatar
    Join Date
    Sep 2008
    Posts
    7,003

    Default

    Quote Originally Posted by K-B View Post
    Okey.. another problem,

    The EA does multiple trades inside 1 bar, what if i don't want that?
    so, it just waits for the next signal?
    Where is this EA as there is several version on the board ?

  4. #14
    Junior Member
    Join Date
    Jan 2009
    Posts
    25

    Thumbs up

    Quote Originally Posted by funyoo View Post
    Where is this EA as there is several version on the board ?
    Sorry my bad,

    It is the STC_COLOR_EA (original was your Schaff Trend CD):
    Schaff Trend Cycle EA <-- permalink


    Thanks in advance,
    K-B

  5. #15
    Administrator funyoo's Avatar
    Join Date
    Sep 2008
    Posts
    7,003

    Default

    Quote Originally Posted by K-B View Post
    Sorry my bad,

    It is the STC_COLOR_EA (original was your Schaff Trend CD):
    Schaff Trend Cycle EA <-- permalink


    Thanks in advance,
    K-B
    Ok, here it is.
    Attached Files Attached Files

  6. #16
    Junior Member
    Join Date
    Jan 2009
    Posts
    25

    Default

    Thanks funyoo!
    You rock!


    K-B

  7. #17

    Default

    Quote Originally Posted by K-B View Post

    The problem is that it buys/sells on the OPEN of the next bar after the color has already changed a bar before that.(see arrows in chart)
    I would like it to buy/sell on the CLOSE of the first bar with a 'new' color.(see pink line in chart)

    Can someone tell me how to get that fixed?
    If you alter the timeframe in the 3 lines of code where iCustom calls your Schaff indicator for different shifts, you will be able to run the EA on a faster timeframe but it will still take its signals from the slower TF that you chose. It will still enter at new bar open, but you will just get more signals.

    For example, changing:

    STC0=iCustom(Symbol(),0,"STC_COLOR",STCPeriod,Fast MAPeriod,SlowMAPeriod,0,i+2);

    to:

    STC0=iCustom(Symbol(),30,"STC_COLOR",STCPeriod,Fas tMAPeriod,SlowMAPeriod,0,i+2);

    will mean that the EA takes 30 minute signals, but you will be able to attach it to a M5 or M15 chart and get those signals more frequently.

    Personally, I would also introduce an external variable by way of a line like this:

    extern int SchaffTF=30;

    and change your iCustom lines to this:

    STC0=iCustom(Symbol(),SchaffTF,"STC_COLOR",STCPeri od,FastMAPeriod,SlowMAPeriod,0,i+2);

    You will then be able to optimise it better.

  8. #18
    Junior Member
    Join Date
    Jan 2009
    Posts
    25

    Default

    Quote Originally Posted by jezzer1961 View Post
    If you alter the timeframe in the 3 lines of code where iCustom calls your Schaff indicator for different shifts, you will be able to run the EA on a faster timeframe but it will still take its signals from the slower TF that you chose. It will still enter at new bar open, but you will just get more signals.

    For example, changing:

    STC0=iCustom(Symbol(),0,"STC_COLOR",STCPeriod,Fast MAPeriod,SlowMAPeriod,0,i+2);

    to:

    STC0=iCustom(Symbol(),30,"STC_COLOR",STCPeriod,Fas tMAPeriod,SlowMAPeriod,0,i+2);

    will mean that the EA takes 30 minute signals, but you will be able to attach it to a M5 or M15 chart and get those signals more frequently.

    Personally, I would also introduce an external variable by way of a line like this:

    extern int SchaffTF=30;

    and change your iCustom lines to this:

    STC0=iCustom(Symbol(),SchaffTF,"STC_COLOR",STCPeri od,FastMAPeriod,SlowMAPeriod,0,i+2);

    You will then be able to optimise it better.


    Thanks mate! really appreciate it!


    K-B

  9. #19
    Junior Member
    Join Date
    Jan 2009
    Posts
    25

    Thumbs up

    Hi Guys,

    I tried to add a filter on the EA.

    It first checks the maintrend through the STC_COLOR indicator on a bigger TF (ie 4H=1440M).

    if up on 4H > only go long on smaller TF (ie 15M) (close if changes color/direction and wait for next long signal while 4H is still up)

    if down on 4H > opposite of what to do when up on 4H..

    I'm not a coder (but really convinced about the STC indicator! Trading with it for a while), i would appreciate it if someone can take a look at my added piece of code..

    The compiler is complaining about a "unbalanced left parenthesis' but i think that's because there just is something wrong/forgotten in my added piece of code..
    Attached Files Attached Files
    Last edited by K-B; 01-14-2009 at 10:39.

  10. #20
    Administrator funyoo's Avatar
    Join Date
    Sep 2008
    Posts
    7,003

    Default

    Quote Originally Posted by K-B View Post
    Hi Guys,

    I tried to add a filter on the EA.

    It first checks the maintrend through the STC_COLOR indicator on a bigger TF (ie 4H=1440M).

    if up on 4H > only go long on smaller TF (ie 15M) (close if changes color/direction and wait for next long signal while 4H is still up)

    if down on 4H > opposite of what to do when up on 4H..

    I'm not a coder (but really convinced about the STC indicator! Trading with it for a while), i would appreciate it if someone can take a look at my added piece of code..

    The compiler is complaining about a "unbalanced left parenthesis' but i think that's because there just is something wrong/forgotten in my added piece of code..
    Hi K-B,

    Here it is.
    Attached Files Attached Files

Similar Threads

  1. Schaff Cycle Trend EA
    By mahiro in forum Ideas for expert advisors
    Replies: 15
    Last Post: 06-23-2011, 22:17
  2. Schaff Trend CD EA
    By funyoo in forum Expert advisors backtesting
    Replies: 17
    Last Post: 07-15-2009, 19:04
  3. Schaff Trend Cycle and SMA cross
    By kikiq in forum Indicators
    Replies: 4
    Last Post: 04-18-2009, 13:48
  4. Schaff Trading Cycle Double
    By gfeliciano in forum Ideas for expert advisors
    Replies: 3
    Last Post: 01-27-2009, 05:24
  5. Schaff Trend CD EA
    By funyoo in forum Expert advisors live statements
    Replies: 0
    Last Post: 11-27-2008, 17:28

Tags for this Thread

backtesting, broker, candle, change, color, demo, eas, expert, forex, forex trading, high, how to, indicator, indicators, main, metatrader, mq4, mql, mql4, mt4, nrp, profit, programming, repaint, request, sells, signal, signals, source, stoch, stop, strategy, support, system, thank you, time, timer, trading, trading system, trend

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •