Results 1 to 4 of 4
 0 Attachment(s)    

Thread: Programming issue

  1. #1

    Default Programming issue

    hi,
    on programming an ea I run into this problem and may someone knows how to solve it?
    The indicator passes the zero line upwards and should trigger a buytrade, and the otherway around: when the indicator crosses the zeroline downward it should trigger a sell.
    But it is not working. Would someone solve this for me?
    The code that should trigger the sell:
    double waarde22 = iCustom(Symbol(),0, "smSuper TRIX_v2", 3, "avarage",1,1,1,"price",0,"signals",false,1,1) ;
    if (waarde22 < 0) selltrigger = 1;

    The code that should trigger the buy:
    double waarde22 = iCustom(Symbol(),0, "smSuper TRIX_v2", 3, "avarage",1,1,1,"price",0,"signals",false,1,1) ;
    if (waarde22 > 0) buytrigger = 1;

  2. #2
    Junior Member
    Join Date
    Jan 2009
    Posts
    28

    Default

    Hmm, probably you can try to display the value of waarde22 out first with the following code:

    Comment(waarde22);

    if the value of waarde22 doesn't show a value that is higher or lower than 0, or if the value of waarde22 doesn't show the appropriate value which corresponds to what you want, then it could be your iCustom function call.

    iCustom MQL 4 Documentation:
    iCustom - MQL4 Documentation

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

    Default

    Quote Originally Posted by roodstaart View Post
    hi,
    on programming an ea I run into this problem and may someone knows how to solve it?
    The indicator passes the zero line upwards and should trigger a buytrade, and the otherway around: when the indicator crosses the zeroline downward it should trigger a sell.
    But it is not working. Would someone solve this for me?
    The code that should trigger the sell:
    double waarde22 = iCustom(Symbol(),0, "smSuper TRIX_v2", 3, "avarage",1,1,1,"price",0,"signals",false,1,1) ;
    if (waarde22 < 0) selltrigger = 1;

    The code that should trigger the buy:
    double waarde22 = iCustom(Symbol(),0, "smSuper TRIX_v2", 3, "avarage",1,1,1,"price",0,"signals",false,1,1) ;
    if (waarde22 > 0) buytrigger = 1;
    Hi roodstaart,

    Replace :

    iCustom(Symbol(),0, "smSuper TRIX_v2", 3, "avarage",1,1,1,"price",0,"signals",false,1,1)

    With :

    iCustom(Symbol(),0, "smSuper TRIX_v2", 3, "avarage",1,1,1,"price",0,"signals",false,0,1)

  4. #4

    Default

    thank you, it works perfectly!

Similar Threads

  1. The Walking Dead gasoline issue
    By fxtester in forum General discussion
    Replies: 0
    Last Post: 02-23-2016, 01:13
  2. MQL4 issue -- Please help me
    By alex_lion in forum MQL programming
    Replies: 0
    Last Post: 11-09-2012, 02:36
  3. Database issue
    By funyoo in forum Announcements and warnings
    Replies: 0
    Last Post: 02-09-2010, 12:03
  4. Connection issue
    By funyoo in forum Announcements and warnings
    Replies: 0
    Last Post: 11-20-2009, 16:48

Tags for this Thread

how to, indicator, indicators, mql, programming, signals, thank you

Posting Permissions

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