Results 1 to 2 of 2
 0 Attachment(s)    

Thread: TSF University

  1. #1

    Default TSF University

    Hi Funyo,

    I hope you wouldn't mind if I start this thread where I can ask questions unrelated to a certain EA. I have many I am not a programmer but can understand certain scripts and its logic. Any member of the TSF community who has advanced programming knowledge is welcome to lend their expertise.

    I have this line in an EA I trying to modify:

    extern bool limitEMA = true; //longs when price is above ema, short only when price below ema

    Can I use Slope Direction Line(SDL) indicator instead? Long only when SDL is colored blue and short only when SDL is colored red. If yes, can you please write the script?

    In addition, what is the command to call "Solar Wind" from an EA? It starts with something like ... SW=iCustom(NULL....."Solar Wind", .....)

    Thanks in advance.

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

    Default

    Quote Originally Posted by tamaraofx View Post
    Hi Funyo,

    I hope you wouldn't mind if I start this thread where I can ask questions unrelated to a certain EA. I have many I am not a programmer but can understand certain scripts and its logic. Any member of the TSF community who has advanced programming knowledge is welcome to lend their expertise.

    I have this line in an EA I trying to modify:

    extern bool limitEMA = true; //longs when price is above ema, short only when price below ema

    Can I use Slope Direction Line(SDL) indicator instead? Long only when SDL is colored blue and short only when SDL is colored red. If yes, can you please write the script?

    In addition, what is the command to call "Solar Wind" from an EA? It starts with something like ... SW=iCustom(NULL....."Solar Wind", .....)

    Thanks in advance.
    Hi tamaraofx,

    Good initiative.

    Code:
    double slope1=iCustom(Symbol(),0,"Slope Direction Line",period,method,price,0,shift);
    double slope1a=iCustom(Symbol(),0,"Slope Direction Line",period,method,price,0,shift+1);
    
    double slope2=iCustom(Symbol(),0,"Slope Direction Line",period,method,price,1,shift);
    double slope2a=iCustom(Symbol(),0,"Slope Direction Line",period,method,price,1,shift+1);
    
    if(slope1!=2147483647 && slope1>=slope1a)... Buy
    if(slope2!=2147483647 && slope2<=slope2a)... Sell
    And,

    Code:
    Green : iCustom(Symbol(),0,"Wolar Wind",period,1,shift);
    Red : iCustom(Symbol(),0,"Wolar Wind",period,2,shift);

Tags for this Thread

indicator, programmer, programming, scripts, solar

Posting Permissions

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