I am running a study that I am trying to optimize, it generates buy and sell signals that I backtest. I'm not sure if the backtest forum is the best forum for my question however. What I would like to do is pass variable values from the price study to another study that would plot below the price study. For example if I kept track of the current trades profit in my price/backtest study I would then like ot plot this below in another study pane. Thanks for the help.
Announcement
Collapse
No announcement yet.
Pass values between studies
Collapse
X
-
Here is what I suggest and yes you can do this on your own.
First, if your system is running on a chart and you want to graph the trade equity data, then you need to create an array that stores this Equity data for each bar on the chart. This is because the new EFS study you create to draw the equity data will need to plot a value for every bar on the chart.
Thus, I would create an array and populate it with the data from your system, then pass that up to GLOBAL memory using setGlobalValue().
Now, in your new EFS, first you need to getGlobalValue() to retrieve the array. Because this efs will be running on the same chart (I assume), you don't need to do anything except PLOT the data in the array. When you get to the current bar (getCurrentBarIndex() == 0), then you need to continue plotting the last item in the array.
Depending on how you want to set this up, I would probably create a timer to handle retrieving the array data from global memory so you don't keep passing/retrieving this array on every tick. Probably every 10~15 seconds would be fast enough.
Hope this helps?Brad Matheny
eSignal Solution Provider since 2000
-
I use SPECIALTY SCRIPTS EFS help files quite often to reference EFS functions and parameter options/syntax.
Look up above and click on FILE SHARING. Then look/search for SPECIALTY SCRIPTS and then look in the EFS HELP folder (I believe). There, you'll find two or three windows help files. Install them on your esignal PC. These are efs lookup/syntax libraries that can help developers find what they need.
In these, you'll find everything you need to "lookup" efs functions/instructions.
With regards to a timer. Let me snow you how to build a basic timer in efs.
PHP Code:/* This timer is set to only check while running in REALTIME (on the last bar on the chart). It does not check on historical data bars
*/
var timertime = null;
function main(T1Length) {
if (T1Length == null) {
// Sets timer length to 15 seconds.
T1Length = 15;
}
if (getCurrentBarIndex() == 0) {
var vTime = new Date();
var vRTHour = vTime.getHours();
var vRTMin = vTime.getMinutes();
var vRTSec = vTime.getSeconds();
var nRTTime = (vRTHour*3600)+(vRTMin*60)+vRTSec;
if ( (nRTTime > (timertime+T1Length)) || (timertime == null)) {
/// .. TIME TO DO SOMETHING!!!
debugPrintln(vRTHour +":"+vRTMin +":"+vRTSec +" Time to do something.");
timertime = nRTTime ;
}
}
}
Brad Matheny
eSignal Solution Provider since 2000
Comment
-
I just went over to the FILE SHARING and sure enough, the EFS HELP FILES are still there.
With regards to these help files, they should work on Vista and if they don't, then I'm sure Microsoft has a fix available on their site. You just have to search the knowledgebase for the solution, then install it.
Please try again.Brad Matheny
eSignal Solution Provider since 2000
Comment
-
I found the files. What do I do with them?
I put the *.chm files in the esignal directory. How do I access them?
Help does not work you know. It displays a message, "Failed to launch help" and pops up a message from Windows saying I can download winhlp32.
The *.chm files are susposed to work with Vista without this Windows 3.1 help file DLL.
Comment
-
I put the files (or shortcuts to them) on my desktop. And yes, you may have to download something from Microsoft if they don't run on your PC.
How you use them is simple, use the INDEX feature to search thru the different items (efs terms and functions) until you find the items you need to lookup.
These files are of great help to me as sometimes I need to identify solutions for my efs problems.
Hope they help.Brad Matheny
eSignal Solution Provider since 2000
Comment
-
great!! Now you need to understand that you don't know everything (yet), but you will learn if you want.
These tools help you understand how to develop efs code. Think of them as "code segments" and you can add them as needed to your projects.
There are different ways of accompishing different tasks. I've shown a few different ways of developing timers. There are also EOB and RT efs options. You have to decide how you want to develop your trading system, then develop features supporting those needs.
Graphics don't take up too much resources. The trick is to limit the TIME TEMPLATE to 3~5 days and then run your analysis model.
EFS is very functional for development. You can build almost anything you can think of. It's just a matter of time and testing to get it working right.
You're on your way. Congrats.Brad Matheny
eSignal Solution Provider since 2000
Comment
-
Originally posted by Doji3333
I put the files (or shortcuts to them) on my desktop. And yes, you may have to download something from Microsoft if they don't run on your PC.
How you use them is simple, use the INDEX feature to search through the different items (efs terms and functions) until you find the items you need to lookup.
These files are of great help to me as sometimes I need to identify solutions for my efs problems.
Hope they help.
"Navigation to the web page was canceled . What you can try:
Retype the address. "
on every page for every item in the index. Obviously I'm missing something here, there's no definitions loading for the items in the Index of functions. Any help in getting this to work for me would be greatly appreciated as this is exactly what I was looking for to help figure things out easier.
The eSignaslEFS2.chm file is 284KB in size so there is stuff on it I just can't see it.
Comment
Comment