enum is not an 'official' type so you can't use it for type casting!
You'd better use (string)Periode()+ ...
Carl Schreiber:
enum is not an 'official' type so you can't use it for type casting! You'd better use (string)Periode()+ ... | void OnStart(){ PrintFormat("%s == %i", EnumToString((ENUM_TIMEFRAMES)Period()),_Period); } 2017.05.08 08:25:49.171 testscr AUDJPY,M1: uninit reason 0 Works fine for me.
2017.05.08 08:25:49.171 testscr AUDJPY,M1: PERIOD_M1 == 1 2017.05.08 08:25:49.171 testscr AUDJPY,M1: initialized |
Bruce Sullivan: does anyone know why "EnumToString((ENUM_TIMEFRAMES)Period())" will not work in stop or limit orders.
| Not a good idea, brokers can change comments, including complete replacement. |
enum is not an 'official' type so you can't use it for type casting!
You'd better use (string)Periode()+ ...
hey carl..... thanks for the reply..... yes actually that is what i use now on the pending orders as a work a round..... DoubleToStr(Period(),0) ......h
Works fine for me. | |
Not a good idea, brokers can change comments, including complete replacement. |
hey whroeder...... thanks..... was hoping you'd reply.... the only place that seems to be an issue is when it's used in a pending orders comment..... the exact same comment will work as expected in any market order.....
when used in a pending order comment, the entire comment is empty.....h
There may be a size limit on the string. My guess is 32 characters.
StringSubstr(EnumToString((ENUM_TIMEFRAMES)Period()),7)+" bbands trail buystop"
There may be a size limit on the string. My guess is 32 characters.
hey ernst..... thanks..... you are absolutely right..... once i took out that extra space it reduced the string to 31 characters and the comment went thru as expected..... thanks again......h

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
this is more of a gee whiz type question, but not knowing the answer tends to annoy me..... does anyone know why "EnumToString((ENUM_TIMEFRAMES)Period())" will not work in stop or limit orders.... it will work in market orders.....
yes it's a seemingly minor issue especially when just using Period() corrects it....... but it weighs on my mind some...... thanks......h
//-----