Assigning values to Global Variables with Custom Code in FX Dreema Studio
-
I have been creating some custom blocks using FX Dreema Studio, and it has been great and really helpful to create my own blocks for the EAs, and this week I got to a situation that seems simple, but I still couldn't figure how to do, I want to assign values to Global Variables, on my custom blocks made with FX Dreema Studio.
Something like what the original "Modify Variables" Block is doing, when we place a variable to receive the values in it. In the example below, the original block is assigning a value to the User Variable called "pip_converter".The question is how to mimic this behavior using FX Dreema Studio?

-

maybe this is what you need instead for the selection underneath?
-
@quantengineer I'm afraid I cannot help with your query but could you please share the created blocks? That would be a very good help to anyone using fxDreema Studio.
-
I did not start the creation of this block yet, because it would require this specific knowledge, on how to assign values to a user variable from the class V:: using FX Dreema studio.
-
Hello @tipsywisdom , thanks for interacting. I am not quite sure i understood what you mean... The block on your description seems to be the original block that assigns values to the user created variables, in the class v::
I am working to make 1 of my custom blocks do the same thing as this block does... I have created a custom formula to calculate trade volumes, and i want to save the calculated volume to any user defined variable , like the "modify variables" block does. -
@quantengineer said in Assigning values to Global Variables with Custom Code in FX Dreema Studio:
Hello @tipsywisdom , thanks for interacting. I am not quite sure i understood what you mean... The block on your description seems to be the original block that assigns values to the user created variables, in the class v::
I am working to make 1 of my custom blocks do the same thing as this block does... I have created a custom formula to calculate trade volumes, and i want to save the calculated volume to any user defined variable , like the "modify variables" block does.sry friend, not sure how to help...why not just use the block as is? As far as I am aware it will still use global variables.
I dont program to the level that you do obviously, but from what I understand people who are at that level, come to dreema for the ease of not having to code every bit of it. just custom stuff that cant be accomplished in dreema. -
@QuantEngineer. did you ever resolve how to do this? I have the same issue. I am unable to update a variable in fxdreema from a custom block directly. I can however call a custom function from fxdreema and pass an array declared thus - double someFunction(int somevar, double &SomeArray[10][10]){}, then called somevar = someFunction(somevar, SomeArray);
This will return your augmented somevar and will also return the array that can be refered to that can have numerous values in it of course. But all of this isn't as simple as getting a value from a custom block. It would be nice if the fxdreema developer could let us know how to do it. -
I haven't found yet the "FXDreema way" to do that... The solution I am using is to declare global variables, classes, arrays, etc... on FXDreema Studio, these objects are public on global level... and can be read from anywhere else in the code... not ideal, because the developer has to know in advance the names of these variables... but it works well also... I would love to know the method officially used by FX Dreema... if someone bumps into it, please make it public...