Announcement

Collapse
No announcement yet.

writing a study on historicals?

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

  • writing a study on historicals?

    I would like to find out how I would write some studies on historicals... for example .. what percentage of the time when closed higher 2 days in a row that we then closed higher on the third day, etc...just a very basic example..


    Can I use efs or do I need to do(find someone to) some other programming?

    Thanks for any help!!

    Wayne

  • #2
    Re: writing a study on historicals?

    Wayne
    You should be able to use efs to accomplish the task. For instance your basic example could be written in either way shown below depending on how you want to set the conditions (note that there are other ways of doing it and that this is just an example)

    PHP Code:
    //if you want to count all consecutive events
    var myCondition1 close(0)>close(-1) && close(-1)>close(-2);//all two consecuutive higher closes
    var my Condition2 close(0)>close(-1) && close(-1)>close(-2) && close(-2)>close(-3);//all three consecutive higher closes
    if(myCondition1Counter+=1;//if myCondition1 is true increase the variable Counter1 by1
    if(myCondition2Counter2+=1;//same for Counter2
    //Counter1 and Counter2 must be global variables
    var myPercent = (Counter2/Counter1)*100;//what percentage is Counter2 of Counter1

    //if you want to count only each first time these events occur
    var myCondition1 close(0)>close(-1) && close(-1)>close(-2) && close(-2)<close(-3);//only first two consecuutive higher closes
    var my Condition2 close(0)>close(-1) && close(-1)>close(-2) && close(-2)>close(-3) && close(-3)<close(-4);//only first three 
                                                                                                        //consecutive higher closes
    if(myCondition1Counter+=1;//if myCondition1 is true increase the variable Counter1 by1
    if(myCondition2Counter2+=1;//same for counter2
    //Counter1 and Counter2 must be global variables
    var myPercent = (Counter2/Counter1)*100;//what percentage is Counter2 of Counter1 
    If you are unfamiliar with programming in efs and are interested in writing the scripts yourself you may want to start by reviewing the JavaScript for EFS video series and the Core JavaScript Reference Guide. Those will provide you with a thorough introduction to programming in JavaScript which is at the foundation of EFS. Then go through the EFS KnowledgeBase and study the Help Guides and Tutorials which will provide you with the specifics of EFS.
    If instead you are looking for someone to write the scripts for you then you may want to review the FAQ: How can I get my custom study built?
    Hope this helps
    Alex


    Originally posted by wmshoe
    I would like to find out how I would write some studies on historicals... for example .. what percentage of the time when closed higher 2 days in a row that we then closed higher on the third day, etc...just a very basic example..


    Can I use efs or do I need to do(find someone to) some other programming?

    Thanks for any help!!

    Wayne

    Comment

    Working...
    X