How to run script with prefix and suffix pair? - page 2

 
Keith Watford:

Ok, so it is not possible for a prefix then.

I still don't understand....

For a suffix, how do you determine...

a. Is there a suffix?

b. The start position of the suffix?

ok

it is not possible as you said all completly..

 
Ahmet Metin Yilmaz:

ok

it is not possible as you said all completly..

That's a shame, I was hoping that I would learn a new trick here.

 
Keith Watford: That's a shame, I was hoping that I would learn a new trick here.

I don't know if you are just joking or you really want to do that for real! If it is for real, I can offer some advice that works on many brokers but not necessarily all of them! Just let me know and I will then post it here.

 
Keith Watford:

That's a shame, I was hoping that I would learn a new trick here.

Actually not. I was only aiming here to briefly ask beginners who come to learn and provide as much information as they can find if they research and read (Not for you!)

 
And make sure that this functionality is available in these forums. It has been asked and answered before.
 
Fernando Carreiro:

I don't know if you are just joking or you really want to do that for real! If it is for real, I can offer some advice that works on many brokers but not necessarily all of them! Just let me know and I will then post it here.

Not joking Fernando.
When Ahmet posted that one could use StringSubstr() to determine any prefix or suffix, I couldn't for the life of me figure out how. So I was intrigued and wanted to know how it could be used for this.

I wanted to know what I had missed.

If you know how to use StringSubstr() for this, I would be interested to know. 

 
Ahmet Metin Yilmaz:

Actually not. I was only aiming here to briefly ask beginners who come to learn and provide as much information as they can find if they research and read (Not for you!)

Ahmet Metin Yilmaz:
And make sure that this functionality is available in these forums. It has been asked and answered before.

I don't know what you are saying here.

 
Keith Watford: Not joking Fernando. When Ahmet posted that one could use StringSubstr() to determine any prefix or suffix, I couldn't for the life of me figure out how. So I was intrigued and wanted to know how it could be used for this. I wanted to know what I had missed. If you know how to use StringSubstr() for this, I would be interested to know. 

I think there is some misunderstanding then. I'm not implying that StringSubstr() would be used to identify which parts are the suffix or prefix, as that function can only "extract" the relevant parts once you know where they are.

I was referring to the rules I usually apply to a symbol name in order to identify the prefix and suffix. Such as looking for delimiters like "." or the use of lowercase when the main symbol is usually in uppercase. That is what I meant!

 

I see.

Not to worry then Fernando.

 
Keith Watford:

I don't know what you are saying here.

Detecting suffixes is not a frequently needed requirement in codes. For this reason, it may not be well known.
However, if you are working on a multi pairs expert, you will need to use a code that detects differences in the symbols used by the broker to ensure that the expert works smoothly on any broker. These often come out as suffixes.
I can show you as an example without going into too much detail;

  string AddChar = StringSubstr(Symbol(),6,4);//Any possible pair suffix

 it detects suffix which the broker use ( if there )

cur1=currency1+AddChar;

where currency1 was used as input.

OrderSend(cur1,OP_BUY,lotss,prc,10,stp,tpro,EANameBuy,magic,0,Blue);

Thus, you can get a transaction in a different currency.

I hope I could explain.

Reason: