Hello All,
Attached you’ll find 2 notepad files, save the “TradingLibrary” file as a .efsLib file in eSignal’s “FunctionLibrary” folder ("TradingLibrary.efsLib") and the other file (“TradeLibrarySyntaxInMain”) you can save however you want, it just shows you how to use the trading library functions and the global variable object...you could also use it as a shell to test an idea out in an “efs” program. What’s nice about this approach is that you take a lot of the clutter out of the program that you’re trying to use to analyze the markets with. I used to paste about 40 global variables into the top of my program and then pasted a long list of lengthy functions underneath main()…what a pain, recently I put it all into a function library that I decided other people would probably find useful.
Some of the benefits of doing this are:
Your trade results will stream to the formula output window in real-time as they are happening, so you can see how your system is performing in real-time. Those results are automatically saved to an array that’s part of the global variable object, so that you can print them to the formula output window and easily copy them into excel so as to compare the streaming trades with a reload of the program…the back-test results. There can be large differences between the two, for example if you are using the closing price to enter/exit a trade, while streaming it’s the current price, but the program “knows” the future closing price when the program is loading…thereby avoiding a lot of bad trades…knowing a bar’s close before it happens is a huge advantage.
You can customize the trading library and the global variable object into whatever you want, but I’d suggest that you keep it generic so that you can use it for any new ideas that you come up with. Keep program specific code in the program and put generic behind the scenes functions into the library.
The library includes a “PrintValues(…args)” function that’s handy to use when you want to print something to the formula output window, instead of
debugPrintln(getCurrentBarIndex() + “\t” + var1 + “\t” + var2 + “\t” + var3 + “\t” + var4);
Pass a comma separated list: TLib.PrintValues(var1, var2, var3, var4); The bar index is automatically included.
If anybody has any question or finds this useful, let me know. If there's no interest, then there's no purpose posting on this forum.
Sincerely, LetUsLearn
Attached you’ll find 2 notepad files, save the “TradingLibrary” file as a .efsLib file in eSignal’s “FunctionLibrary” folder ("TradingLibrary.efsLib") and the other file (“TradeLibrarySyntaxInMain”) you can save however you want, it just shows you how to use the trading library functions and the global variable object...you could also use it as a shell to test an idea out in an “efs” program. What’s nice about this approach is that you take a lot of the clutter out of the program that you’re trying to use to analyze the markets with. I used to paste about 40 global variables into the top of my program and then pasted a long list of lengthy functions underneath main()…what a pain, recently I put it all into a function library that I decided other people would probably find useful.
Some of the benefits of doing this are:
Your trade results will stream to the formula output window in real-time as they are happening, so you can see how your system is performing in real-time. Those results are automatically saved to an array that’s part of the global variable object, so that you can print them to the formula output window and easily copy them into excel so as to compare the streaming trades with a reload of the program…the back-test results. There can be large differences between the two, for example if you are using the closing price to enter/exit a trade, while streaming it’s the current price, but the program “knows” the future closing price when the program is loading…thereby avoiding a lot of bad trades…knowing a bar’s close before it happens is a huge advantage.
You can customize the trading library and the global variable object into whatever you want, but I’d suggest that you keep it generic so that you can use it for any new ideas that you come up with. Keep program specific code in the program and put generic behind the scenes functions into the library.
The library includes a “PrintValues(…args)” function that’s handy to use when you want to print something to the formula output window, instead of
debugPrintln(getCurrentBarIndex() + “\t” + var1 + “\t” + var2 + “\t” + var3 + “\t” + var4);
Pass a comma separated list: TLib.PrintValues(var1, var2, var3, var4); The bar index is automatically included.
If anybody has any question or finds this useful, let me know. If there's no interest, then there's no purpose posting on this forum.
Sincerely, LetUsLearn
Comment