Page 1 of 1

RegApplyToPriceOption and RegMATypeOption problem

Posted: Mon Mar 17, 2014 12:05 pm
by tpr
Hi,

I try to create my own indicator using MS Visual 2010 C++.
I have problem with RegApplyToPriceOption(), RegMATypeOption() functions.
Here is piece of code:

Code: Select all

TPriceType ApplyToPrice = pt_HLC3;
TMAType MAType = ma_EMA;
RegApplyToPriceOption((int&)ApplyToPrice, "Apply to Price");
RegMATypeOption((int&)MAType, "MA Type");


These function seem to ignore initial values of variables.
I can set new values and then everything is OK.
But first time indicator properties window appears
there is "Close" and "SMA" instead of "Open" and "(High+Low+Close)/3".

BTW - RegApplyToPriceOption() and RegMATypeOption() are not metioned in Indicator API manual.

Thanks,
tpr

Re: RegApplyToPriceOption and RegMATypeOption problem

Posted: Tue Mar 18, 2014 12:09 am
by KelvinHand
tpr wrote:Hi,

I try to create my own indicator using MS Visual 2010 C++.
I have problem with RegApplyToPriceOption(), RegMATypeOption() functions.
Here is piece of code:

Code: Select all

TPriceType ApplyToPrice = pt_HLC3;
TMAType MAType = ma_EMA;
RegApplyToPriceOption((int&)ApplyToPrice, "Apply to Price");
RegMATypeOption((int&)MAType, "MA Type");


These function seem to ignore initial values of variables.
I can set new values and then everything is OK.
But first time indicator properties window appears
there is "Close" and "SMA" instead of "Open" and "(High+Low+Close)/3".

BTW - RegApplyToPriceOption() and RegMATypeOption() are not metioned in Indicator API manual.

Thanks,
tpr



Yes. There is a bug in each function. Just need to goto technicalfunctions.h
Remark the option before function return

void RegApplyToPriceOption(int& option, PChar name)
{
...
//option = 0;
}

RegMATypeOption(int& option, PChar name)
{
....
//option = 0;

}

Re: RegApplyToPriceOption and RegMATypeOption problem

Posted: Tue Mar 18, 2014 6:58 am
by tpr
Thank you, it is OK now.
Anyway I hope it will be fixed "officially" (in patch).
It is kind of weird to fix on my own code provided with ForexTester software.

Regards,
tpr