Help me understand a warning.
double PriceSeries ( Applied_Price appliedprice, // Price constant uint bar, // Index of shift relative to the current bar for a specified number of periods back or forward const double& Open [], const double& Low [], const double& High [], const double& Close[] )
You cannot use pre-defined variables for user variable names
Why would you want to, the values are available to the function anyway.
- Exactly. Either use the predefined arrays explicitly or define your arrays like OnCalculate
Don't hard code numbers. If you make any change to the enum, your code breaks. enum Applied_Price // Type of constant { Price_Close, // Close Price_Open, // Open : switch(appliedprice){ case 0: return(Close[bar]); case 1: return(Open [bar]); :
Write self documenting code enum Applied_Price // Type of constant { Price_Close, // Close Price_Open, // Open : switch(appliedprice){ case Price_Close: return Close[bar]; case Price_Open: return Open [bar]; :
Thank You, i'll try to work around with your suggestion..
I'm trying to run this function, is made for custom priceseries, basically input are:
-Price applied to (close,low,high ect)
-index of shift
-open,close,high,low from OnCalculate
this is the function.
But i do get this error:
Can't figure it out.