I have written an indicator (MyCustomIndicator) which I wish to use in a strategy. The indicator uses four parameters. The parameters, however, are alll cosmetic: colors, fonts, etc. and are not required for the operation of the indicator. I have properly exposed the variables BullFlag and BearFlag in my indicator and I do update them manually.
In my strategy I would like to use an expression of the form:
if(MyCustomIndicator().BullFlag)
{ ... }
The issue is that this statement will create an error during compilation because MyCustomIndicator does not have an overload with zero parameters.
So I have two questions:
1. Do I have to include ALL the parameters in the calling statement? For example,
if(MyCustomIndicator(param1, param2, param3, param4).BullFlag). Or, can I include only one parameter? For example, if(MyCustomIndicator(param1).BullFlag). This will compile.
2. Is there any way to overload MyCustomIndicator so that I can use it inside a trategy with zero parameters. For example as ... if(MyCustomIndicator().BullFlag)...without compilation errors?
Please advise. Thank you very much.
Comment