Bollinger Bands - MA Type=illegal value

How to create strategies and indicators
Message
Author
fx_pete
Posts: 17
Joined: Mon Jan 30, 2012 2:31 pm

Bollinger Bands - MA Type=illegal value

#1 Postby fx_pete » Wed Feb 08, 2012 12:20 am

When I create a Bollinger Band using CreateIndicator() with the following code:

Code: Select all

char argBuff[1000]; // argument buffer

// define CreateIndicator() parameters argument
sprintf(argBuff, "%d;%f;0;Close", Period, stdDev, "BollingerBands");

// create the indicator and get its handle
indBB = CreateIndicator(currency, timeFrame, "BollingerBands", argBuff);


where according to the API doc. the BollingerBands function is defined as follows:
Bollinger Bands ='BollingerBands'
'<Period: integer>; <Deviation: double>; <Shift: integer>; <ApplyToPrice: string>'

'8;2.00;0;Close'
0=Top band buffer
1=Central band buffer
2=Bottom band buffer


I get an illegal value displayed in the MA Type option of the Bollinger Band plotted on the chart. Obviously there must be a way to set the MA Type of the Bollinger Band using CreateIndicator() no? So I am asuming the API doc. is wrong again. Can you please confirm?

Peter

ps: oh yeah and I can see that the API doc is wrong in specifying the buffer number to use for each of the bands. Come on guys how is one supposed to be able to code with documentation like this. Haven't these issues been brought up already? This is basic stuff. ....

FT Support
Posts: 905
Joined: Sat Jul 11, 2009 10:54 am

#2 Postby FT Support » Thu Feb 09, 2012 6:20 am

Hello,

Sorry for the inconvenience, we've updated some indicators recently but probably forgot to update docs.

Please use this initialization string for BB:
'8;2.00;0;Close;Simple (SMA)'

General rule is: Open the settings window of the indicator and use exactly same values in your initialization string. For example if you see "Simple (SMA)" in the settings then you should use this text in code.

P.S. Will ask programmers about correct indexes of BB buffers
Attachments
BB.jpg
BB.jpg (48.7 KiB) Viewed 11801 times
Check our other product here:
http://www.forexcopier.com

fx_pete
Posts: 17
Joined: Mon Jan 30, 2012 2:31 pm

re:

#3 Postby fx_pete » Thu Feb 09, 2012 1:24 pm

Thank you for this info, that should prevent further questions about issues with indicator parameters.

Also I no longer think there is an issues with the band buffers of the BB function. I jumped to conclusion way too quickly on that one 8)

Thanks for your help.

Peter


Return to “FT API”

Who is online

Users browsing this forum: No registered users and 24 guests