Results 1 to 7 of 7
 0 Attachment(s)    

Thread: Something strange

  1. #1

    Default Something strange

    hy
    interesting example which i'nt undestand

    STOM1 =iStochastic(Symbol(),0,Stoch_KP,PERIOD,Slowing,MO DE_SMA,0,MODE_MAIN,0);
    STOM2 =iStochastic(Symbol(),0,Stoch_KP,PERIOD,Slowing,MO DE_SMA,0,MODE_MAIN,i);
    STOS1 =iStochastic(Symbol(),0,Stoch_KP,PERIOD,Slowing,MO DE_SMA,0,MODE_SIGNAL,0);
    STOS2 =iStochastic(Symbol(),0,Stoch_KP,PERIOD,Slowing,MO DE_SMA,0,MODE_SIGNAL,i);

    //condition for open trade
    string Stochbuy="false";string Stochsel="false";
    if(STOM2>High_l && STOM3<High_l && STOM2>STOS2)Stochbuy="true";
    if(STOM2<Low_l && STOM3>Low_l && STOM2<STOS2)Stochsel="true";

    with this condition ea don,t open trade
    but in this :
    string Stochbuy="false";string Stochsel="false";
    if(STOM2>High_l && STOM2>STOS2)Stochbuy="true";
    if(STOM2<Low_l && STOM2<STOS2)Stochsel="true";
    yes. it's working
    i tried on different timeframe, why ? maybe i don't see what's wrong

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

    Default

    Quote Originally Posted by przem81621 View Post
    hy
    interesting example which i'nt undestand

    STOM1 =iStochastic(Symbol(),0,Stoch_KP,PERIOD,Slowing,MO DE_SMA,0,MODE_MAIN,0);
    STOM2 =iStochastic(Symbol(),0,Stoch_KP,PERIOD,Slowing,MO DE_SMA,0,MODE_MAIN,i);
    STOS1 =iStochastic(Symbol(),0,Stoch_KP,PERIOD,Slowing,MO DE_SMA,0,MODE_SIGNAL,0);
    STOS2 =iStochastic(Symbol(),0,Stoch_KP,PERIOD,Slowing,MO DE_SMA,0,MODE_SIGNAL,i);

    //condition for open trade
    string Stochbuy="false";string Stochsel="false";
    if(STOM2>High_l && STOM3<High_l && STOM2>STOS2)Stochbuy="true";
    if(STOM2<Low_l && STOM3>Low_l && STOM2<STOS2)Stochsel="true";

    with this condition ea don,t open trade
    but in this :
    string Stochbuy="false";string Stochsel="false";
    if(STOM2>High_l && STOM2>STOS2)Stochbuy="true";
    if(STOM2<Low_l && STOM2<STOS2)Stochsel="true";
    yes. it's working
    i tried on different timeframe, why ? maybe i don't see what's wrong
    Hi przem81621,

    STOM3 is not defined.

  3. #3

    Default

    Quote Originally Posted by funyoo View Post
    Hi przem81621,

    STOM3 is not defined.
    STOM3 =iStochastic(Symbol(),0,Stoch_KP,PERIOD,Slowing,MO DE_SMA,0,MODE_MAIN,i+1);

    is defined, in first post i don't put in,

  4. #4
    Junior Member Paulus.O's Avatar
    Join Date
    Mar 2009
    Location
    Indonesia
    Posts
    8

    Default

    maybe your code lack of "(" and ")"
    try this:

    //condition for open trade
    string Stochbuy="false";string Stochsel="false";
    if((STOM2>High_l) && (STOM3<High_l) && (STOM2>STOS2))Stochbuy="true";
    if((STOM2<Low_l) && (STOM3>Low_l) && (STOM2<STOS2))Stochsel="true";

  5. #5

    Default

    Quote Originally Posted by funyoo View Post
    Hi przem81621,

    STOM3 is not defined.
    hmm, if condition was wrote that :

    if(STOM2<STOM3 &&
    STOM2<25 && STOM3>25 && STOM2<STOS2)Stochsel="true";
    it's ok.
    why?
    but if :
    extern double level=25;
    STOM2<level && STOM3>level
    no working

  6. #6

    Default

    You need to give a bit more information than just a few snippets if you want anybody to help. The lines of code that you have pasted are meaningless as things stand.

    There could be a bug elsewhere in the code or it could even be that the logic itself is flawed and your conditions never even get met.

  7. #7

    Default

    Quote Originally Posted by jezzer1961 View Post
    You need to give a bit more information than just a few snippets if you want anybody to help. The lines of code that you have pasted are meaningless as things stand.

    There could be a bug elsewhere in the code or it could even be that the logic itself is flawed and your conditions never even get met.
    yes. you're completly right
    I wrote here because i don't know anybody who knows anything about mql4 ,
    the logic ea is ok, now i'm testing ,
    only what changed is this:
    mistake was on twice declared type of level, one is it value, second is zero .
    So condition never will be good.
    thanks, sorry for english
    Last edited by przem81621; 03-16-2009 at 17:03.

Similar Threads

  1. Strange Pyramid EA
    By Lordvader in forum Expert advisors backtesting
    Replies: 13
    Last Post: 11-08-2009, 19:22

Tags for this Thread

high, low, main, mql, signal, sma

Posting Permissions

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