Programmatically adding MA to CCI indicator in Strategy

How to create strategies and indicators
Message
Author
imamushroom
Posts: 33
Joined: Wed Jan 20, 2016 2:52 pm

Programmatically adding MA to CCI indicator in Strategy

#1 Postby imamushroom » Wed Oct 04, 2017 4:50 pm

Hi,

I've added a CCI indicator to my strategy but I know need to add a Moving Average to the CCI data. Under the MA indicator price parameter, there isn't an option to add an existing indicator so could you explain how I do this, please. I'm using C++.

Thanks,

FX Helper
Posts: 1477
Joined: Mon Apr 01, 2013 3:55 am

Re: Programmatically adding MA to CCI indicator in Strategy

#2 Postby FX Helper » Thu Oct 12, 2017 7:27 am

Hello,

Do you want to add an indicator to an indicator?
Or do you want to add a new parameter (indicator) in the properties of a strategy?

As far as I know, you can't do these both.

The only way is to get the data of your Moving Average via the method GetMA.

imamushroom
Posts: 33
Joined: Wed Jan 20, 2016 2:52 pm

Re: Programmatically adding MA to CCI indicator in Strategy

#3 Postby imamushroom » Mon Oct 16, 2017 7:33 am

Within a strategy that I am writing in C++ I want to put a moving average of the results returned from the CCI indicator programmatically. Is there a MovingAverageOnArray type of function that I can use or am I forced to create one myself?

FX Helper
Posts: 1477
Joined: Mon Apr 01, 2013 3:55 am

Re: Programmatically adding MA to CCI indicator in Strategy

#4 Postby FX Helper » Tue Oct 31, 2017 8:01 am

Hello,

Sorry, but Forex Tester program doesn't have iMAonArray function, only iMA.
So if you want to use an analog of iMAonArray function, the only way is to write it for yourself.

In other case, you need to add CCI indicator into a strategy.
You need to create it via CreateIndicator and then use GetIndicatorValue function (you can read about this functions in the Help files in the Forex Tester program).


Return to “FT API”

Who is online

Users browsing this forum: No registered users and 24 guests