Results 1 to 2 of 2
 1 Attachment(s)    

Thread: [REQ] newsfilter?!?

  1. #1

    Question [REQ] newsfilter?!?

    Hi folks,
    does somebody have a newsfilter indicator (code) which could be added to an EA and which is working e.g. with forex-tsd.com newsreader or forexfactory.com newsreader?
    Could you share it, please? That would be great!
    Thank you for your efforts!
    Best regards!

  2. #2
    Junior Member xux99's Avatar
    Join Date
    Nov 2008
    Location
    Greece
    Posts
    8

    Default

    This code is for FFCal indicator.
    Code:
    extern bool      NewsFilter                       = true;
    extern int       MinutesBeforeNews                = 10;
    extern int       MinutesAfterNews                 = 10;
    extern bool      IncludeHigh                      = true;
    extern bool      IncludeMedium                    = true;
    extern bool      IncludeLow                       = false;
    extern bool      IncludeSpeaks                    = true;
    extern bool      ReportAllForUSD                  = false;
    int              MinutesUntilNextEvent,MinutesAfterPrevEvent;
    bool             TradingTime[30];
    datetime         OTime[30];
    Call this function to check if trading is permitted.
    Code:
    bool NewsPeriod()
    {if (OTime[22]!=iTime(Symbol(),1,0)) {OTime[22]=iTime(Symbol(),1,0);
    if (OTime[22]>=OTime[4] && NewsFilter)
    {MinutesUntilNextEvent=iCustom(Symbol(),0,"FFCal",IncludeHigh,IncludeMedium,IncludeLow,IncludeSpeaks,true,0,true,-1,-1,ReportAllForUSD,1,1);
    MinutesAfterPrevEvent=iCustom(Symbol(),0,"FFCal",IncludeHigh,IncludeMedium,IncludeLow,IncludeSpeaks,true,0,true,-1,-1,ReportAllForUSD,1,0);
    if (MinutesUntilNextEvent!=99999 || MinutesAfterPrevEvent!=99999)
    {OTime[2]=iTime(Symbol(),1,0)-(MinutesAfterPrevEvent-MinutesAfterNews)*60;
    OTime[3]=iTime(Symbol(),1,0)+(MinutesUntilNextEvent-MinutesBeforeNews)*60;
    OTime[4]=iTime(Symbol(),1,0)+(MinutesUntilNextEvent+MinutesAfterNews)*60;}}
    TradingTime[2]=(OTime[22]>=OTime[2] && (OTime[22]<OTime[3] || OTime[22]>=OTime[4]));} return(TradingTime[2]);}
    Attached Files Attached Files
    Last edited by xux99; 04-21-2010 at 23:59.

Similar Threads

  1. Help adding newsfilter
    By cybman in forum MQL programming
    Replies: 0
    Last Post: 09-28-2011, 10:09

Tags for this Thread

forex, indicator, trading

Posting Permissions

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