Announcement

Collapse
No announcement yet.

specific time bars on 24hr using 60min chart

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

  • specific time bars on 24hr using 60min chart

    I am trying to have an indicator marker show up on a time bar (actually only a specific time bar) when it is lower than another time bar (again, a specific, set time bar). To be more precise I am using a 24 hour chart on 60min time-frame. I want to compare the 14:00 close with the 20:00 close from the previous day. If it is lower I want to display a marker. I want to do something a bit more advanced than this but if I can get these basics, hopefully I can work the rest myself.

    Thanks in advance.

  • #2
    wilczek
    One way to accomplish that is to store in a global variable the value at 20:00 and then compare the value at 14:00 against that variable. As a first step declare the global variable
    PHP Code:
    var ValueAtEight 0;
     
    function 
    main(){ 
    Then inside main check for the time to be equal to 20:00 and assign the value of the Close to the variable
    PHP Code:
    if((hour(0)*100)+minute(0)==2000){
        
    ValueAtEight close(0);

    At this point you create another condition in which you check for the time to be equal to 14:00 and when that occurrs you check the value of the Close against that of the variable and execute whatever commands you need
    PHP Code:
    if((hour(0)*100)+minute(0)==1400){
        if(
    close(0)>ValueAtEight){
            
    //commands to be executed here
        
    }

    Alex

    Comment


    • #3
      Thanks for the quick reply, I am only using the wizard as my programming is not so good, is it possible to do this within the wizard ?

      Thanks again.

      Comment


      • #4
        wilczek
        You are most welcome.
        It is not possible to do this using only the Formula Wizard as it requires creating a global variable which the Formula Wizard cannot do.
        You may want to try using the efs template which is available here and that includes comments explaining where to insert your code
        Having said that if you are unfamiliar with programming in efs then you may find it to your benefit 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.
        Alex

        Comment

        Working...
        X