string to number. How to remove please.?
Though, the program serves the purpose for which it is intended. But I am not comfortable with the warning "implicit conversion from
PriceDateString should be declared as string since you asign it a value from string type.
string PriceDateString = IntegerToString(PriceDateLong);
int PriceLeftShift = iBarShift(NULL,0,StringToInteger(PriceDateString),false);
or better
//Trying to get the shift value of a vertical line whose name is stored in the variable VertName. long PriceDateLong = ObjectGetInteger(0,VertName,OBJPROP_TIME,0); long PriceDateString = PriceDateLong; int PriceLeftShift = iBarShift(NULL,0,PriceDateString,false); Print("PriceDate ",PriceLeftShift);
or best
//Trying to get the shift value of a vertical line whose name is stored in the variable VertName. long PriceDateLong = ObjectGetInteger(0,VertName,OBJPROP_TIME,0); // long PriceDateString = IntegerToString(PriceDateLong); int PriceLeftShift = iBarShift(NULL,0,PriceDateLong,false); Print("PriceDate ",PriceLeftShift);
Why are you converting the datetime from VertName to a string and then back to a long and then back to a datetime? Just use it in iBarShift.
Nikolay Georgiev:
PriceDateString should be declared as string since you asign it a value from string type.
or better
or bes
Thanks all. I guess I was overzealous.

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register