Forex



Go Back   Forex Trading > Downloads > Expert Advisors - Metatrader 4
Forex Forum Register More recent Blogs Calendar Advertising Others Help






Register
Welcome to Forex-TSD!, one of the largest Forex forums worldwide, where you will be able to find the most complete and reliable Forex information imaginable.

From the list below, select the forum that you want to visit and register to post, as many times you want. It’s absolutely free. Click here for registering on Forex-TSD.

EXCLUSIVE FORUM
The Exclusive Forum is the only paid section. Once you subscribe, you will get free access to real cutting-edge Trading Systems (automated and not), Indicators, Signals, Articles, etc., that will help and guide you, in ways that you could only imagine, with your Forex trading.
  • Elite Section
    Get access to private discussions, specialized support, indicators and trading systems reported every week.
  • Advanced Elite Section
    For professional traders, trading system developers and any other member who may need to use and/or convert, the most cutting-edge exclusive indicators and trading systems for MT4 and MT5.
See more

 
 
Thread Tools
 
Old 02-27-2007, 08:32 AM
Member
 
Join Date: Feb 2007
Posts: 30
justize is on a distinguished road
BollingerBands Construction in an EA

Hi,
I need help again.

----------------------------------
int time2 = 5; //used timeframe
double derivation=2 ; // derivation
double Bollinger,BolValue;

Bollinger = iBands(NULL,0,4*time2,derivation,0,PRICE_TYPICAL,0 ,0);
BolValue = iBandsOnArray(array[],0,derivation,0,0,0);
----------------------------------

I am working on an EA. Now I need the BollingerBands as a filter for my signals.
How can i construct the real values of the BollingerBands as I see, when I drop the Indicator on the chart?
The first double called "Bollinger" seems to be the MA in the middle of the BBs.
So I think the "BolValue" is the pos. and neg. difference between the middle-MA and the Bands - right?
So, if thats right - what do i have to choose for ARRAY[] ?. If that must be loop or somethink, can someone tell me the whole loop?.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
 
Old 02-28-2007, 05:57 AM
Member
 
Join Date: Feb 2007
Posts: 30
justize is on a distinguished road
Doesn´t know anyone, how to use it?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
 
Old 02-28-2007, 06:30 AM
igorad's Avatar
Senior Member
 
Join Date: Oct 2005
Location: Ukraine
Posts: 960
igorad is on a distinguished road
Quote:
Originally Posted by justize
Hi,
I need help again.

----------------------------------
int time2 = 5; //used timeframe
double derivation=2 ; // derivation
double Bollinger,BolValue;

Bollinger = iBands(NULL,0,4*time2,derivation,0,PRICE_TYPICAL,0 ,0);
BolValue = iBandsOnArray(array[],0,derivation,0,0,0);
----------------------------------

I am working on an EA. Now I need the BollingerBands as a filter for my signals.
How can i construct the real values of the BollingerBands as I see, when I drop the Indicator on the chart?
The first double called "Bollinger" seems to be the MA in the middle of the BBs.
So I think the "BolValue" is the pos. and neg. difference between the middle-MA and the Bands - right?
So, if thats right - what do i have to choose for ARRAY[] ?. If that must be loop or somethink, can someone tell me the whole loop?.
Firstly, you should know the formula of BB:
- UpBB = MA(N) + deviation*StdDev(N)
- DnBB = MA(N) - deviation*StdDev(N)
where N - period of BB
Second, if you wish to receive difference between Upper and Lower bands(or BBWidth) then you should use the following formula:

BBWidth = UpBB - DnBB = 2*deviation*StdDev(N).

Standard Deviation(iStdDev(...)) you can find in the built-in indicators.
__________________
Let's improve trade skills together
http://finance.groups.yahoo.com/group/TrendLaboratory
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
 
Old 02-28-2007, 07:17 AM
Senior Member
 
Join Date: Dec 2005
Posts: 142
trevman is on a distinguished road
the middle of the bollinger matches is the same as a MA try placing a SMA20 over a SMA20 bollinger band. the higher and lower boll value can be gotten with

iBands(NULL,0,20,2,0,PRICE_LOW,MODE_UPPER,0)
iBands(NULL,0,20,2,0,PRICE_LOW,MODE_LOWER,0)

so just take a SMA from the high, or the low from the SMA. hope that helps (i didnt really read the question.
__________________
There is no candle.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
 
Old 02-28-2007, 10:29 AM
Member
 
Join Date: Feb 2007
Posts: 30
justize is on a distinguished road
Thanks, that was it
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
 
Old 02-28-2007, 10:34 AM
Member
 
Join Date: Feb 2007
Posts: 30
justize is on a distinguished road
I´m writing the code now, and i see, you have used "PRICE_LOW":

iBands(NULL,0,20,2,0,PRICE_LOW,MODE_UPPER,0)
iBands(NULL,0,20,2,0,PRICE_LOW,MODE_LOWER,0)

Can´t I choose PRICE_TYPICAL better?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
 
Old 02-28-2007, 09:27 PM
Senior Member
 
Join Date: Dec 2005
Posts: 142
trevman is on a distinguished road
yeah you can change to any price, the info i got was from the MT4 help file, as is;

iBands(symbol,timeframe,period,deviation,bands_shi ft,applied_price,mode,shift)
__________________
There is no candle.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
 

Bookmarks
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
BollingerBands-Fibo CP6 Indicators - Metatrader 4 6 09-03-2006 10:07 AM


All times are GMT. The time now is 04:02 PM.



Search Engine Friendly URLs by vBSEO 3.2.0 ©2008, Crawlability, Inc.