|
TheGrumble
2011-10-03 18:28:22
|
|
I need a way to compare the results from a custom indicator for the present close against the previous close as part of the indicator processing.
The indicator itself gets a result over a specified period but it is not clear how to store it so it can be used as part of the next close.
I have tried using Global.GetVariable\SetVariable, but it does not appear to be storing the information when run as part of the indicator script.
Is there something I am missing? Is there a straight forward way to compile the indicator for the current and previous close in one shot?
Thanks in advance.
|
|
|
|
QuantShare
2011-10-04 17:35:15
0
|
|
What do you mean by the "next close". Next bar?
I am not sure I understand exactly what you are trying to do.
|
|
|
|
TheGrumble
2011-10-04 23:38:12
1
|
|
Sure next bar. I want to store the indicator result for the previous bar's value so I can compare it to the indicator result of the current bar. This needs to happen for every bar. I want to be able to flag a change in the result and disregard subsequent results that are equal assuming the indicator returns 1 or 0. Flag 0->1 or 1->0; discard 1->1 or 0->0.
|
|
|
|
QuantShare
2011-10-05 06:06:56
0
|
|
Can you please send your indicator to support@quantshare.com
|
|
|
|
TheGrumble
2011-10-12 19:02:19
0
|
|
I was able to figure this out and I got the indicator working.
Using the "Create Functions" to develop the indicator, it seems only one result can be returned at a time. I need to run my indicator multiple times to get results for differnt modes. I can change it to one iteration if I can return more that one result array per indicator invocation. Is there a way to return more that one result array per indicator call?
If not, what about storing the numeric array for each result that I need globally and then retrieve them by calling a separate helper scripts. Will the stored arrays persistent in memory after the first indicator complete so that other scripts can retrieve the information?
Lastly, the indicator does not run automatically when I start up the quantshare. Some times I have to edit the and save the indicator code before it starts working again. How do I fix that?
|
|
|
|
QuantShare
2011-10-13 04:29:36
0
|
|
Yes, only one result can be returned at a time.
You can however add a parameter and then change the return value depending on this parameter.
This way you can return different results depending on the value of the parameter you provide.
You can also use "Global" variable to save data globally. Data is kept in memory after the indicator calculation is completed.
Regarding your indicator:
Which version of QuantShare are you using?
What happens when it does not run automatically?
|
|
|
|
TheGrumble
2011-10-19 15:11:32
0
|
|
I was able to use "Global" variable to retrieve multiple results. Thanks.
However, I am still having the problem with my indicators run with I start up Quantshare. The version I am using is Premium 2.4.4. I have it the final set of indicators called as a formula under "Trading Rule". So at the very least I would need to double click for the calulation to begin and the resulting data applied to the chart. But this does not happen. No matter how many time I click it on the formula, the indicators do not run. I actually have to go to each indicator and force it to recompile during the current session before formula with custom indicators work. Is the "Trading Rules" correct place for the custom indicator?
Note there is an entry for the my formula under the "Update Formular Dynamically" drop down at quantshare startup but it does not run even after I double click on it. It just taking a lot of time to get things working which I would like to avoid. Any ideas how to resolve this?
|
|
|
|
QuantShare
2011-10-21 05:45:44
0
|
|
Can you please send the last trace files to support@quantshare.com
You can find the "Trace" directory under "QuantShare" directory
|
|
|
|
Vangelis M.
2011-10-30 19:55:50
0
|
|
I am having the same problem (QS 2.5.2)
It seems Global cannot be created from the Indicator Formula. (works fine in C# editor)
I am basically trying to set and retrieve a Global Var from the Indicator Formula so I can plot it.
I created two Functions :
SetMember(string1,string2,VectorD1) --->Global.SetVariable( string1[0] + string2[0] , value );
GetMember(string1,string2) --->result.Assign((VectorD)Global.GetVariable(string1[0]+string2[0]));
Now when i write in the Indicator formula:
z=SetMember("a","b",rsi(14)) ;
plot(GetMember("a","b") ,"",colorBlack);
It works the first time. If I quit QS and reopen, it does not work. If I go and edit the function in "Create Functions" tool and then "Save", then it works again.
V.M.
|
|
|
|
QuantShare
2011-10-31 07:26:29
0
|
|
I was able to reproduce this issue. Thank you for reporting it. It will be fixed in the next release.
|
|
|
|
Vangelis M.
2011-12-02 09:15:21
0
|
|
As far as I can tell, this issue (see previous post) was fixed in QS 2.5.3. as promised .
Thank you QS.
V.M.
|
|
|
|
QuantShare
2011-12-02 10:53:45
0
|
|
Best Answer
Yes, fixed in this new version
|
|
|
|
TheGrumble
2011-12-02 20:49:02
0
|
|
I noticed that it is fixed as well. Thanks for resolved the issue so quickly.
|
|
|
|