Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (opm), 778 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 3 1 2 3
Multicurrency Currency Strength #486597
09/08/22 20:58
09/08/22 20:58
Joined: Sep 2022
Posts: 13
J
JJ95 Offline OP
Newbie
JJ95  Offline OP
Newbie
J

Joined: Sep 2022
Posts: 13
Greetings all,

I would like to ask and consult your opinions. I am a big fan of the currency strength, and I was exposed to a concept, which is when a currency is too strong or to weak, it would likely to reverse and start a new trend (similarly to the RSI).

However, I really need a visual input. It make me feel more confident when I look at the chart and inspect it. Is it possible to display the ccyStrength on to the chart (plotting it, like a sub-window).

Visual Clarification can be found in image attached.
In the image attached, we can see that in a sub-window we see different lines, with different color. Each line belong to a specific currency. Can this be achieved in Zorro?

Sincerely

Attached Files Screenshot_20220909-005443_TradingView.jpg
Re: Multicurrency Currency Strength [Re: JJ95] #486604
09/09/22 13:17
09/09/22 13:17
Joined: Aug 2017
Posts: 294
Netherlands
G
Grant Offline
Member
Grant  Offline
Member
G

Joined: Aug 2017
Posts: 294
Netherlands

Re: Multicurrency Currency Strength [Re: Grant] #486619
09/10/22 16:30
09/10/22 16:30
Joined: Sep 2022
Posts: 13
J
JJ95 Offline OP
Newbie
JJ95  Offline OP
Newbie
J

Joined: Sep 2022
Posts: 13
Hello,

Thank you so much for your reply! The links were very insightful.

I did notice in the links stating to have a look over the source code if needed. As I was looking over it, I noticed the following:

#define MAXCURRENCIES 32
var CStren[MAXCURRENCIES],CStrenSum[MAXCURRENCIES];
int CNum[MAXCURRENCIES];
char CNames[MAXCURRENCIES*4];
int NumCurrencies = 0;

Max Currencies is defined at 32.

My question is:

Why is it 32 (why did they choose this number specifically)?

In my case for instance, I am interested in trading the following currencies EUR, USD, AUD, CHF, NZD, GBP, JPY (which makes up around 28 currency pair). Am I suppose to change that number?

Once again, thank you so much for your reply earlier, it was very helpful!

Re: Multicurrency Currency Strength [Re: JJ95] #486622
09/10/22 17:04
09/10/22 17:04
Joined: Feb 2017
Posts: 1,718
Chicago
AndrewAMD Offline
Serious User
AndrewAMD  Offline
Serious User

Joined: Feb 2017
Posts: 1,718
Chicago
Count it again: You only have seven currencies (it has nothing to do with pairs). Having a max allows the use of fixed buffers. No need to change it, since you are well below the maximum.

Re: Multicurrency Currency Strength [Re: JJ95] #486623
09/10/22 17:16
09/10/22 17:16
Joined: Aug 2017
Posts: 294
Netherlands
G
Grant Offline
Member
Grant  Offline
Member
G

Joined: Aug 2017
Posts: 294
Netherlands
I guess (but I don't know for sure) that 32 was chosen due to the 32-bit architecture of Zorro, although they made a transition to 64-bit lately. edit: see Andrew's answer above.

Anyhow, 28 pairs is no problem. Just throw them in a loop. See https://zorro-project.com/manual/en/loop.htm for code examples.

Last edited by Grant; 09/10/22 17:18.
Re: Multicurrency Currency Strength [Re: JJ95] #486625
09/11/22 16:39
09/11/22 16:39
Joined: Sep 2022
Posts: 13
J
JJ95 Offline OP
Newbie
JJ95  Offline OP
Newbie
J

Joined: Sep 2022
Posts: 13
Hello,

I think I understood what you are saying. At the moment, I am trying to understand the codes regarding currency strengths.

#define MAXCURRENCIES 32
var CStren[MAXCURRENCIES],CStrenSum[MAXCURRENCIES];
int CNum[MAXCURRENCIES];
char CNames[MAXCURRENCIES*4];
int NumCurrencies = 0;

Regarding CNames, the size of the array is 32 * 4 = 128.

Does this mean that CNames can hold 128 elements?
If yes, is there any reason why number 4 is chosen?

Thank you for your response earlier, it was much appreciated

Re: Multicurrency Currency Strength [Re: JJ95] #486626
09/11/22 18:58
09/11/22 18:58
Joined: Feb 2017
Posts: 1,718
Chicago
AndrewAMD Offline
Serious User
AndrewAMD  Offline
Serious User

Joined: Feb 2017
Posts: 1,718
Chicago
It’s because in the C language, you need a null terminator to end a string. So USD is three characters plus a null terminator, which is 4 total. So you have room for 32 currency names. For that, you need 128 characters to fit them.

Re: Multicurrency Currency Strength [Re: AndrewAMD] #486628
09/11/22 21:39
09/11/22 21:39
Joined: Sep 2022
Posts: 13
J
JJ95 Offline OP
Newbie
JJ95  Offline OP
Newbie
J

Joined: Sep 2022
Posts: 13
Hi,

So, just for clarification. We are working with 32 currencies (not currency pairs), and each currency is an element in an array that has 3 letters plus null terminator, so that is 4 characters total per element (32 × 4 = 128).

Is that correct?

Re: Multicurrency Currency Strength [Re: JJ95] #486629
09/11/22 21:46
09/11/22 21:46
Joined: Feb 2017
Posts: 1,718
Chicago
AndrewAMD Offline
Serious User
AndrewAMD  Offline
Serious User

Joined: Feb 2017
Posts: 1,718
Chicago
Yes.

Re: Multicurrency Currency Strength [Re: Grant] #486631
09/12/22 15:14
09/12/22 15:14
Joined: Sep 2022
Posts: 13
J
JJ95 Offline OP
Newbie
JJ95  Offline OP
Newbie
J

Joined: Sep 2022
Posts: 13
Hello,
I have a small question to ask: Below is a simple code I wrote:

CODE:

function main()
{
for(int i=0; i<10; i++){
printf("%d\n", i);
}
}

When I run the code above, I get: "Error in line 4: syntax error". I cannot find this syntax error

However, when I run the code below, I do not get an error:

function main()
{
int i;
for(i=0; i<10; i++){
printf("%d\n", i);
}
}

To my knowledge both codes are the same. I am studying the ccyReset() in the indicator source code file and they have it written as the first code written above.
Can you please explain to me where is my syntax error?

Last edited by JJ95; 09/12/22 15:14. Reason: Spelling Mistake
Page 1 of 3 1 2 3

Moderated by  Petra 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1