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

 
Ahmet Metin Yilmaz:

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;

 it detects suffix which the broker use ( if there )

where currency1 was used as input.

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

I hope I could explain.

Your code fails on so many levels! Why would you expect to find the suffix always a position 6 and always with a length of 4. That is crazy.

Symbol names are not always 6 characters long. They can easily be of any length (e.g. "BRENT", "WTI", "MSFT", etc.).

Brokers use all manner of formats that would just break under your code (with a prefix without suffix, or with suffix without prefix, or both, or with or without delimiters, etc.).

 
Fernando Carreiro:

Your code fails on so many levels! Why would you expect to find the suffix always a position 6 and always with a length of 4. That is crazy.

Symbol names are not always 6 characters long. They can easily be of any length (e.g. "BRENT", "WTI", "MSFT", etc.).

Brokers use all manner of formats that would just break under you code (with a prefix without suffix, or with suffix without prefix, or both, or with or without delimiters, etc.).

Yes you are right. But I said that I wrote this without going into too much detail just to be an example and give an idea.

 
Ahmet Metin Yilmaz:Yes you are right. But I said that I wrote this without going into too much detail just to be an example and give an idea.

That is like saying: "here is an example of how to use knife to tighten a screw", instead of actually using screw-driver and not a knife.

 
Fernando Carreiro:

(with a prefix without suffix, or with suffix without prefix, or both, or with or without delimiters, etc.).

There are different solutions for all of them, as you know.

 
Fernando Carreiro:

That is like saying: "here is an example of how to use knife to tighten a screw", instead of actually using screw-driver and not a knife.

I think it would be more correct to say that.
Teaching how to fish instead of giving fish.
After all, the people who ask here are asking to learn how to encode. This is the forum page, not the freelance section.

 
Ahmet Metin Yilmaz: I think it would be more correct to say that. Teaching how to fish instead of giving fish. After all, the people who ask here are asking to learn how to encode. This is the forum page, not the freelance section.
That is not the problem. The problem is that you are teaching them the wrong thing! You "fish" with a net or fishing pole, but you are teaching them to fish with "bow and arrow". That might work under a pinch, but they are the wrong tools. You are just making them go in the wrong direction in their learning process. That is what I don't agree with!
 
Fernando Carreiro:
That is not the problem. The problem is that you are teaching them the wrong thing! You "fish" with a net or fishing pole, but you are teaching them to fish with "bow and arrow". That might work under a pinch, but they are the wrong tools. You are just making them go in the wrong direction in their learning process. That is what I don't agree with!

Those who do not know that a problem has more than one solution may misjudge the solution other than their own. I acknowledge that there are other solutions, and I say I simply showed you a way to just give an idea. If you don't agree with this, would you please write a solution include all possibilities here?

 
Ahmet Metin Yilmaz: would you please write a solution include all possibilities here?
No!
 
Fernando Carreiro:
No!

I already thought so.!

 
Ahmet Metin Yilmaz: I already thought so.!

As you said it yourself. Don't give them the "fish", teach them instead!.

I did offer to to teach how to "fish", but only Keith answered and said it was not necessary.

You however, did not ask to be taught how to "fish". You asked for the "fish" itself. So I said no!

Reason: