Announcement

Collapse
No announcement yet.

Alex Could you please help.

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Alex Could you please help.

    ALex, I've been trying to write an EFS that should be easy, but i just don't seem to be able to do it. Could you please help me.

    It is a simple EFS, I want to plot on a daily chart as an indicator the following condition.

    For all of the past days i want to calculate the number of stocks in my array (the SOX index) that are above their 10 day simple moving average as a percentage from 0 % to 100%. I want to also be able to have the indicator update the calculation for each new update during the trading day, or update every 30 seconds or so. I've got my upper and lower bands on the chart, but i can't find any example of comparing the close data against the 10 day moving average. Please feel free to cut add anything you need to.
    Thank you so much for your help.

    Mike T.

    /***/

    function preMain() {
    setStudyTitle("SEMI 10 DAY");
    setShowCursorLabel("true");
    setStudyMin(0);
    setStudyMax(100);
    setCursorLabelName("SEMI 10 DAY",0);
    setDefaultBarStyle(PS_SOLID, 0);
    setDefaultBarStyle(PS_SOLID, 1);
    setDefaultBarFgColor(Color.green, 0);
    setDefaultBarFgColor(Color.maroon, 1);
    setDefaultBarThickness(2, 0);
    setDefaultBarThickness(2, 1);
    setPlotType(PLOTTYPE_LINE, 0);
    setPlotType(PLOTTYPE_LINE, 1);

    }
    var SymCount = 13;
    var turnonflag = "false";
    MySymbls = new Array("MXIM","KLAC","NSM","BRCM","LLTC","XLNX","NV LS","INTC","TXN","ALTR",
    "STM","TER","AMAT","MOT","AMD","MU","TSM","LSI ");

    function main() {

    addBand(10,PS_SOLID,1,Color.green,2);
    addBand(80,PS_SOLID,1,Color.red,1);
    var p=0;

    for (x=0; x<SymCount; x++) {
    nSymb=MySymbls[x];

    if(close(0,1,nSymb) > 8);

    p=p+1;

    }

    return (p);

    }

  • #2
    Mike
    The main problem I see in this script is the number of symbols being used which is well over the current limit of 5 set for efs.
    Anyhow, while some parts of the efs may be relatively straightforward to code (albeit not necessarily simple) the programming required to synchronize all the historical data can be complex at this time and is beyond what I am available to do.
    I would suggest that you contact an eSignal Development Partner to have the efs done for you.
    Alex

    Comment

    Working...
    X