• Home
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • User/Email: Password:
  • 7:35am
Menu
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • 7:35am
Sister Sites
  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Options

Bookmark Thread

First Page First Unread Last Page Last Post

Print Thread

Similar Threads

10 Ema and 200 Ema cross system 6 replies

EMA crossover (ema 14 & 34) 4 replies

Need a EMA based Bollinger Band Indicator 3 replies

Di Napoli, RSI, EMA 5 min system 14 replies

ema bollinger band alerts 1 reply

  • Trading Systems
  • /
  • Reply to Thread
  • Subscribe
  • 9
Attachments: 5 min 13 EMA band System
Exit Attachments
Tags: 5 min 13 EMA band System
Cancel

5 min 13 EMA band System

  • Last Post
  •  
  • 1 Page 2
  • 1 Page 2
  •  
  • Post #21
  • Quote
  • Mar 28, 2007 8:14pm Mar 28, 2007 8:14pm
  •  tjames35
  • | Joined Feb 2007 | Status: Member | 22 Posts
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Green
#property indicator_color2 Red

extern int EMA_Period=13;
extern int EMA_Band=13;
extern int CCI_Period=14;
extern double CCI_UpLevel=40;
extern double CCI_DnLevel=-40;
extern bool UseAlert=true;
extern bool SendEmail=false;
extern int Repeat=3;
extern int Periods=5;
int Crepeat=0;
int AlertTime=0;
int Bar=0;

int DotPip=7;

//---- buffers


double BuyBuffer[];
double SellBuffer[];

double CciCurrent=0, CciPrevious=0;
double EmaCurrent=0;
double EmaUpBand=0;
double EmaDnBand=0;
double LastState[];



//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
Crepeat=Repeat;
IndicatorBuffers(3);
//---- indicators
SetIndexStyle(0,DRAW_ARROW,EMPTY);
SetIndexArrow(0,233);
SetIndexBuffer(0, BuyBuffer);

SetIndexStyle(1,DRAW_ARROW,EMPTY);
SetIndexArrow(1,234);
SetIndexBuffer(1, SellBuffer);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//---- TODO: add your code here
RefreshRates();
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{

int limit;
int counted_bars=IndicatorCounted();
if (counted_bars<0) return (-1);
if (counted_bars>0) counted_bars--;
limit=(Bars-counted_bars)-1;

LastState[0]=0;

for(int i=limit; i>=0; i--) {
CciCurrent=iCCI(NULL,0,CCI_Period,PRICE_TYPICAL,i);
CciPrevious=iCCI(NULL,0,CCI_Period,PRICE_TYPICAL,(i+1));
EmaCurrent=iMA(NULL,0,EMA_Period,0,MODE_EMA,PRICE_CLOSE,i);
EmaUpBand=EmaCurrent+EMA_Band*Point;
EmaDnBand=EmaCurrent-EMA_Band*Point;
if (High[i]>=EmaDnBand && Low[i]<=EmaDnBand && CciCurrent>CCI_DnLevel && CciCurrent<CCI_UpLevel) {
BuyBuffer[i]=Low[i]-DotPip*Point;
LastState[0]=1;
}
else {
BuyBuffer[i]=0;
}

if (High[i]>=EmaUpBand && Low[i]<=EmaUpBand && CciCurrent>CCI_DnLevel && CciCurrent<CCI_UpLevel) {
SellBuffer[i]=High[i]+DotPip*Point;
LastState[0]=-1;
}
else {
SellBuffer[i]=0;
}

}


if (SellBuffer[Bar]>0) Alerts(0,1,0,0);
else if (BuyBuffer[Bar]>0) Alerts(1,0,0,0);
else Alerts(0,0,0,0);


//----
return(0);
}

void Alerts(int _buy, int _sell, int _exitbuy, int _exitsell) {
string AlertStr="";
AlertStr="";
string CurDate="";
CurDate=TimeToStr(CurTime(),TIME_DATE|TIME_MINUTES);
//Alert system
if (UseAlert)
{

if (_buy==1)
{
if (Crepeat==Repeat)
{
AlertTime=0;
}
if (Crepeat>0 && (CurTime()-AlertTime)>Periods)
{
if (_buy==1) {
AlertStr=AlertStr+"Attention! EmaCci Buy Signal"+" Ask="+DoubleToStr(Ask,Digits)+" at "+CurDate;
Alert(Symbol()," ",Period(), ": ",AlertStr);
if (SendEmail)
{
SendMail(Symbol()+" "+Period()+ ": ",Symbol()+" "+Period()+": "+AlertStr);
}


Crepeat=Crepeat-1;
AlertTime=CurTime();
}

}
}

if (_sell==1)
{
if (Crepeat==Repeat)
{
AlertTime=0;
}
if (Crepeat>0 && (CurTime()-AlertTime)>Periods)
{
if (_sell==1) {
AlertStr=AlertStr+"Attention! EmaCci Sell Signal "+" Bid="+DoubleToStr(Bid,Digits)+" at "+CurDate;
Alert(Symbol()," ",Period(), ": ",AlertStr);
if (SendEmail)
{
SendMail(Symbol()+" "+Period()+ ": ",Symbol()+" "+Period()+": "+AlertStr);
}


Crepeat=Crepeat-1;
AlertTime=CurTime();
}

}
}

if (_exitsell==1)
{
if (Crepeat==Repeat)
{
AlertTime=0;
}

if (Crepeat>0 && (CurTime()-AlertTime)>Periods)
{
if (_exitsell==1) {
AlertStr=AlertStr+"Attention! Please check to close sell; ";
Alert(Symbol()," ",Period(), ": ", AlertStr);
if (SendEmail)
{
SendMail(Symbol()+" "+Period()+ ": ",Symbol()+" "+Period()+": "+AlertStr);
}


Crepeat=Crepeat-1;
AlertTime=CurTime();
}

}

}


if (_exitbuy==1)
{
if (Crepeat==Repeat)
{
AlertTime=0;
}
if (Crepeat>0 && (CurTime()-AlertTime)>Periods)
{
if (_exitbuy==1) {
AlertStr=AlertStr+"Attention! Please check to close buy; ";
Alert(Symbol()," ",Period(), ": ",AlertStr);
if (SendEmail)
{
SendMail(Symbol()+" "+Period()+ ": ",Symbol()+" "+Period()+": "+AlertStr);
}


Crepeat=Crepeat-1;
AlertTime=CurTime();
}

}
}

if (_exitbuy==0 && _exitsell==0 && _buy==0 && _sell==0)
{
Crepeat=Repeat;
AlertTime=0;
}

}
//



//----
return;
}
Ed
 
 
  • Post #22
  • Quote
  • Mar 28, 2007 11:48pm Mar 28, 2007 11:48pm
  •  tjames35
  • | Joined Feb 2007 | Status: Member | 22 Posts
This should work best of the rest
Attached File(s)
File Type: ex4 iEmaCci3.ex4   8 KB | 506 downloads
Ed
 
 
  • Post #23
  • Quote
  • Mar 29, 2007 1:35am Mar 29, 2007 1:35am
  •  tjames35
  • | Joined Feb 2007 | Status: Member | 22 Posts
Hi Here is the EA for backtesting
Attached File(s)
File Type: ex4 eEmaCci3.ex4   40 KB | 441 downloads
Ed
 
 
  • Post #24
  • Quote
  • Apr 6, 2007 10:12am Apr 6, 2007 10:12am
  •  JayJay
  • | Joined Apr 2006 | Status: Member | 107 Posts
TJames
This looks imteresting. Would you please post a template.
Thank You jj/.



Quoting tjames35
Disliked
This should work best of the rest
Ignored
TJ

 
 
  • Post #25
  • Quote
  • Apr 8, 2007 3:36pm Apr 8, 2007 3:36pm
  •  Pip Hunter
  • | Joined Oct 2006 | Status: Member | 301 Posts
Quoting tjames35
Disliked
Carmel you have to add the cci indicator and the ema bands separately on the chart then you will see if the arrows line up with the settings. make the settings 20 ema 6 bands 6 period cci with levels 4,-12. I have not checked yet if the new indicator is the same or not..ill let you know if it isnt
Ignored
I'm not understanding the settings "6 bands 6 period" could someone expain that part for me? My MT4 doesn't have a bands selection for either the ema or the cci as far as I can tell from looking at them. Also, does anyone know what type of ema, open close, etc? Really looking forward to trying this out so if anyone could be of help, that would be greatly appreciated.

A round of pips for everyone!!

Pip Hunter
PipHunter
 
 
  • Post #26
  • Quote
  • Jul 23, 2007 9:22pm Jul 23, 2007 9:22pm
  •  jeffreytp
  • | Joined Jan 2007 | Status: Member | 344 Posts
Quoting tjames35
Disliked
Sorry the files were to big for the last post so Ive only included one here
Ignored
Can you please tell us what represents the "channel" i.e. the upper & lower white lines, and the red line in the middle?
 
 
  • Post #27
  • Quote
  • Jul 23, 2007 10:53pm Jul 23, 2007 10:53pm
  •  fairwind
  • | Joined Dec 2004 | Status: Member | 140 Posts
I cant get any sense out of these indics either. The best I got were some "BUY" arrows without any opposing "SELL" arrows.

I copied both code sets and both of them refuse to work. One of them gave the "error" message as shown in the pic attached.

I would like to get this up and running as CCI is one of my favorite indics.

Anyone got any clues about this lot?
Attached Image (click to enlarge)
Click to Enlarge

Name: CCI and MA.jpg
Size: 32 KB
Good Trading to All ---- fairwind
 
 
  • Post #28
  • Quote
  • Jul 23, 2007 11:07pm Jul 23, 2007 11:07pm
  •  achandrasek
  • | Joined Feb 2006 | Status: Member | 476 Posts
Quoting fairwind
Disliked
I cant get any sense out of these indics either. The best I got were some "BUY" arrows without any opposing "SELL" arrows.

I copied both code sets and both of them refuse to work. One of them gave the "error" message as shown in the pic attached.

I would like to get this up and running as CCI is one of my favorite indics.

Anyone got any clues about this lot?
Ignored
Just remove the "space" between PRICE_ and CLOSE (it should be PRICE_CLOSE). Then it should compile.
 
 
  • Post #29
  • Quote
  • Jul 23, 2007 11:26pm Jul 23, 2007 11:26pm
  •  fairwind
  • | Joined Dec 2004 | Status: Member | 140 Posts
Hi there "99",

Re "...Just remove the "space" between PRICE_ and CLOSE (it should be PRICE_CLOSE). Then it should compile...."

You are correct, it does compile now, however, the indic now refuses to load!?

I think I have to give up on this lot. The originator doesn't seem to be available any longer. I will try to PM him and see what that brings.

Thank you for your input "99"
Good Trading to All ---- fairwind
 
 
  • Post #30
  • Quote
  • Sep 11, 2007 9:06am Sep 11, 2007 9:06am
  •  pips_warrior
  • | Joined Aug 2007 | Status: Member | 68 Posts
i think you have a good system tjames....
but.. why you discontinue your posting?

regards,
"Live is for living not for working"
 
 
  • Post #31
  • Quote
  • Last Post: Sep 11, 2007 12:00pm Sep 11, 2007 12:00pm
  •  deforexit
  • | Joined Jun 2007 | Status: Member | 110 Posts
Can anybody post a template?
Thank you
 
 
  • Trading Systems
  • /
  • 5 min 13 EMA band System
  • Reply to Thread
    • 1 Page 2
    • 1 Page 2
0 traders viewing now
Top of Page
  • Facebook
  • Twitter
About FF
  • Mission
  • Products
  • User Guide
  • Media Kit
  • Blog
  • Contact
FF Products
  • Forums
  • Trades
  • Calendar
  • News
  • Market
  • Brokers
  • Trade Explorer
FF Website
  • Homepage
  • Search
  • Members
  • Report a Bug
Follow FF
  • Facebook
  • Twitter

FF Sister Sites:

  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Forex Factory® is a brand of Fair Economy, Inc.

Terms of Service / ©2023