Announcement

Collapse
No announcement yet.

EFS... The most difficult trade script!

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Opium
    started a topic EFS... The most difficult trade script!

    EFS... The most difficult trade script!

    How many of you saw anyone write a public trade script using EFS? Search on Google, it is not only "few", but it is absolute "rare".

    I've use eSignal for years. EFS study is always a pain to develop. I've read all the available material I can find in eSignal guide. However, these material are so outdated which date back to eSignal 10. Many functions in eSignal 12 are missing, incomplete or useless. The EFS KB is not available for years. So there is hardly anything I can refer to.

    I don't know why eSignal make EFS so complicated and confusing. For a trade script, it should be easy to use and simple to understand within hours. Base on Javascript, EFS "should be" very powerful with OO capability. However, for an OO language, you need a good debugger to work with it. All we have is a debugPrintln(). That's all! Nothing else. The worst thing is, some studies come with eSignal, it is 100% working. But when you try to trace its variable changes during execution, its value is always NaN. So I got a working study but cannot trace its value change?

    There is 2 kind of input variables. You can use simple VAR xxx or VAR new Array(). So what's the difference between these 2? All I know is it seemed you cannot debug a simple var variable during runtime. So if the developer does not know how the var value changes, how can he debug his study? An OO is very powerful! But how many of you ever use EFS OO capability?

    If eSignal like to make EFS powerful, please do like what MetaTrader do with their EA. If eSignal wants to make EFS popular, please do like ThinkOrSwim script. Just a plain brain dead script will be sufficient for most traders. A simple trade script should be done in several lines, not in hundreds of line of code to show how good you are.

  • LetUsLearn
    replied
    When you return more than one variable back from main to the chart, you must return it as an array of values, hence return new Array(Filt, FIR). Your variables Filt and FIR are just variables that you are trying to trace, so when you try to print new Array(FIR) you get null because you are declaring an array with a length of FIR and trying to print it.
    You need to change your debugPrintln statement to the following in order to print the values to the formula output window:
    // trace
    debugPrintln("FIR Array = " + FIR); or better yet (“FIR = “ + FIR); and something similar below.
    if (getCurrentBarCount() < 50) return;
    // trace Array
    debugPrintln("Filt Array = " + Filt);
    debugPrintln("FIR Array = " + FIR);

    Leave a comment:


  • ACM
    replied
    Opium

    I don't know what h12() stand for?

    Neither it shows any help in code hinting.


    Why should it need getvalue(n) to retrieve its content?
    There are plenty of threads in this forum that explain when to use getValue() to retrieve a specific value from a series object and/or when to use the series so I would suggest you search these forums as these topics have been discussed at length many times over the years

    FIR and Filt use simple calculation in code. These 2 vars are series objects for sure.
    No they are not. They are simple values
    Alex


    Originally posted by Opium View Post
    Thanks demarco,

    There is no secret to my code. I just try efs example and find hard time to trace any var value;

    Following is the code I try to learn EFS coding from

    Code:
    var fpArray = new Array();
    var bInit = false;
    
    function preMain() {
    setPriceStudy(true);
    setStudyTitle("FIR");
    
    setCursorLabelName("Filt", 0);
    setDefaultBarFgColor(Color.RGB(0xFE,0x69,0x00), 0);
    setDefaultBarThickness(2, 0);
    
    setCursorLabelName("FIR", 1);
    setDefaultBarFgColor(Color.RGB(0x00,0x94,0xFF), 1);
    setDefaultBarThickness(2, 1);
    
    var x = 0;
    
    fpArray[x] = new FunctionParameter("gamma", FunctionParameter.NUMBER);
    with(fpArray[x++]) {
    setName("Gamma");
    setLowerLimit(0.01);
    setDefault(0.8);
    }
    }
    
    var L0_1 = 0;
    var L1_1 = 0;
    var L2_1 = 0;
    var L3_1 = 0;
    
    var L0 = 0;
    var L1 = 0;
    var L2 = 0;
    var L3 = 0;
    
    var xhl2 = null;
    
    function main(gamma) {
    
    if(gamma == null)
    gamma = 0.8;
    
    if (bInit == false) {
    xhl2 = hl2();
    bInit = true;
    }
    
    if (getBarState() == BARSTATE_NEWBAR) {
    L0_1 = L0;
    L1_1 = L1;
    L2_1 = L2;
    L3_1 = L3;
    }
    
    var Filt = 0;
    var FIR = 0;
    var sum = 0;
    var i = 0;
    
    L0 = (1 - gamma) * xhl2.getValue(0) + gamma * L0_1;
    
    // trace
    debugPrintln("xh12 get value = " + xhl2.getValue(0));
    L1 = -gamma * L0 + L0_1 + gamma * L1_1;
    L2 = -gamma * L1 + L1_1 + gamma * L2_1;
    L3 = -gamma * L2 + L2_1 + gamma * L3_1;
    
    Filt = (L0 + 2 * L1 + 2 * L2 + L3) / 6;
    
    for (i = - 3; i &lt;= 0; i++) {
    if (i == 0 || i == -3)
    k = 1;
    else
    k = 2;
    sum += k * xhl2.getValue(i);
    // trace
    debugPrintln("xhl2.getValue(i) " + xhl2.getValue(i));
    }
    
    FIR = sum / 6;
    // trace
    debugPrintln("FIR Array = " + new Array(FIR));
    
    if (getCurrentBarCount() &lt; 50) return;
    // trace Array
    debugPrintln("Filt Array = " + new Array(Filt));
    debugPrintln("FIR Array = " + new Array(FIR));
    return new Array(Filt, FIR);
    }
    The out windows show this:
    Code:
    No Syntax Errors.
    FIR Array =
    xhl2.getValue(i) null
    xhl2.getValue(i) null
    xhl2.getValue(i) null
    xhl2.getValue(i) null
    xh12 get value = null
    I have several problems with this code:
    1. I don't know what h12() stand for? Highest of past 12 bars? It seemed like a build-in function, but I cannot find any reference for it. Neither it shows any help in code hinting. This is not a single case. There are tons of undocumented function in EFS sample code.
    2. Why should it need getvalue(n) to retrieve its content? It should hold a series of value. However, when I debugprint it, only 1 line of zero.
    3. I try to print out Filt and FIR value. Same! No value at all. FIR and Filt use simple calculation in code. These 2 vars are series objects for sure. Then how come it needs an Array to get it back? There is no documentation in EFS tell the user when to use what? Everything is try-and-error.
    EFS makes everything should be simple task extremely painful. Outdated documentation and online training video make it useless. Tradescript should be easy and brain-dead to write. You can develop a complex software lie eSignla, but cannot design a better tradescript? Include the forum I am using right now. How come this forum can be slow and unresponsive? ICE is a billions of dollars exchange group, will it be too expensive for them to lease a decent cloud server?

    Any help will be grateful! Thanks!

    Leave a comment:


  • Opium
    replied
    Thanks demarco,

    There is no secret to my code. I just try efs example and find hard time to trace any var value;

    Following is the code I try to learn EFS coding from

    Code:
    var fpArray = new Array();
    var bInit = false;
    
    function preMain() {
    setPriceStudy(true);
    setStudyTitle("FIR");
    
    setCursorLabelName("Filt", 0);
    setDefaultBarFgColor(Color.RGB(0xFE,0x69,0x00), 0);
    setDefaultBarThickness(2, 0);
    
    setCursorLabelName("FIR", 1);
    setDefaultBarFgColor(Color.RGB(0x00,0x94,0xFF), 1);
    setDefaultBarThickness(2, 1);
    
    var x = 0;
    
    fpArray[x] = new FunctionParameter("gamma", FunctionParameter.NUMBER);
    with(fpArray[x++]) {
    setName("Gamma");
    setLowerLimit(0.01);
    setDefault(0.8);
    }
    }
    
    var L0_1 = 0;
    var L1_1 = 0;
    var L2_1 = 0;
    var L3_1 = 0;
    
    var L0 = 0;
    var L1 = 0;
    var L2 = 0;
    var L3 = 0;
    
    var xhl2 = null;
    
    function main(gamma) {
    
    if(gamma == null)
    gamma = 0.8;
    
    if (bInit == false) {
    xhl2 = hl2();
    bInit = true;
    }
    
    if (getBarState() == BARSTATE_NEWBAR) {
    L0_1 = L0;
    L1_1 = L1;
    L2_1 = L2;
    L3_1 = L3;
    }
    
    var Filt = 0;
    var FIR = 0;
    var sum = 0;
    var i = 0;
    
    L0 = (1 - gamma) * xhl2.getValue(0) + gamma * L0_1;
    
    // trace
    debugPrintln("xh12 get value = " + xhl2.getValue(0));
    L1 = -gamma * L0 + L0_1 + gamma * L1_1;
    L2 = -gamma * L1 + L1_1 + gamma * L2_1;
    L3 = -gamma * L2 + L2_1 + gamma * L3_1;
    
    Filt = (L0 + 2 * L1 + 2 * L2 + L3) / 6;
    
    for (i = - 3; i &lt;= 0; i++) {
    if (i == 0 || i == -3)
    k = 1;
    else
    k = 2;
    sum += k * xhl2.getValue(i);
    // trace
    debugPrintln("xhl2.getValue(i) " + xhl2.getValue(i));
    }
    
    FIR = sum / 6;
    // trace
    debugPrintln("FIR Array = " + new Array(FIR));
    
    if (getCurrentBarCount() &lt; 50) return;
    // trace Array
    debugPrintln("Filt Array = " + new Array(Filt));
    debugPrintln("FIR Array = " + new Array(FIR));
    return new Array(Filt, FIR);
    }
    The out windows show this:
    Code:
    No Syntax Errors.
    FIR Array = 
    xhl2.getValue(i) null
    xhl2.getValue(i) null
    xhl2.getValue(i) null
    xhl2.getValue(i) null
    xh12 get value = null
    I have several problems with this code:
    1. I don't know what h12() stand for? Highest of past 12 bars? It seemed like a build-in function, but I cannot find any reference for it. Neither it shows any help in code hinting. This is not a single case. There are tons of undocumented function in EFS sample code.
    2. Why should it need getvalue(n) to retrieve its content? It should hold a series of value. However, when I debugprint it, only 1 line of zero.
    3. I try to print out Filt and FIR value. Same! No value at all. FIR and Filt use simple calculation in code. These 2 vars are series objects for sure. Then how come it needs an Array to get it back? There is no documentation in EFS tell the user when to use what? Everything is try-and-error.
    EFS makes everything should be simple task extremely painful. Outdated documentation and online training video make it useless. Tradescript should be easy and brain-dead to write. You can develop a complex software lie eSignla, but cannot design a better tradescript? Include the forum I am using right now. How come this forum can be slow and unresponsive? ICE is a billions of dollars exchange group, will it be too expensive for them to lease a decent cloud server?

    Any help will be grateful! Thanks!

    Leave a comment:


  • demarcog
    replied
    Opium,

    As a user of eSignal for many years I agree with many of your points. It is unfortunate for their customers that unlike other vendors you will not find a single functioning sample EFS trading strategy that will in real time execute trades using the eSignal Paper Broker using current generic broker functions.

    I published the only one I've ever seen on the forum, that at the time in 2008 when the volatility was extraordinary was actually very profitable

    You should however be able to trace any variable using debugPrintln() I trace each variable in my code and do not get that error can you post an example?

    It's safe to assume most users are not looking at charts for academic reasons but to hopefully trade profitably. One would think with the millions of dollars customers have paid eSignal that they would provide a workable trading template that can be enhanced or modified with some potential to be used as a profitable strategy, as many other vendor's provide.

    Choosing not to publish examples that would help customers utilize the product as is standard with other vendors is one issue as you indicated.

    A much more fundamental problem is the back tester in particular, over inflates the profitability of the most basic trading strategy when multiple time intervals, a feature that is a part of the product for many years now.

    As support requested when the incident was opened I documented and posted this issue to the forum clearly demonstrating the hyper inflated profit result reported by the back tester many months ago, and have not heard back regarding the back testing problem.

    https://forum.esignal.com/forum/trad...ferent-results

    https://forum.esignal.com/forum/prod...t-trade-prices

    The strategy utilizes multiple time intervals and the profits reported when back tested compared to when executed real time are drastically different, going well beyond any slippage, a clear programming defect or "bug".

    I'm not sure if the eSignal community at large is interested in the product functioning in-line with the advertised features but if so by others not weighing in that will unfortunately never happen

    As bad as eSignal's lack of support would be for even the smallest of firms. The fact that this is an ICE/NYSE subsidiary selling a product perhaps unintentionally, with grossly exaggerated profits could appear that they are in effect fleecing their customers is astonishing. One would think they would mitigate the risk by having a developer resolve the issue, or explain the reason for the hyper inflated results in my posts.

    Having used the product for years and familiar with the support staff I know this is not their intent but can easily be misconstrued to be the case.

    Which is why I am hopeful that they simply address this one individual issue with the back tester.

    Hope this helps.

    glen.demarco@gmail.com
    Last edited by demarcog; 08-27-2019, 06:54 PM.

    Leave a comment:

Working...
X