Announcement

Collapse
No announcement yet.

Multiple days chart

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

  • Multiple days chart

    Hello

    I have been looking for a way to make a multiple day chart without success.

    I need to compress the daily chart for instance into a 4 days chart.

    Not a time template thing but rather as a rolling 4 days. That is the past 4 candles are compress into the last candle of the chart. Then the previous 4 days into the previous from last and so on and so forth

    Basically I need to visualize the chart a bit like the weekly but on an in between time frame

    Is there a natural way of doing this in e-signal or do I have to program it as an EFS.

    in AFS I can draw just about anything but I have never attempted to redraw a cnalde my own way ....

    Any idea ?
    Has anyone done this before ?

    Thanks
    Claude

  • #2
    Hello Claude,

    Currently, this type of interval cannot be created in the Advanced Chart. If you would like our development team to consider adding this feature in a future version, please submit your request to [email protected].

    The data that would make up the 4D chart data could be collected using the daily interval through EFS. You would store the values in some global variables or arrays, depending on your specific needs. I would first create a global counter variable and increment this variable by 1 at each instance of BARSTATE_NEWBAR. When the variable reaches 5, reset it to 1.

    PHP Code:
    if (getBarState() == BARSTATE_NEWBAR) {
        
    nCount++
        if (
    nCount 4nCount 1;

    Use this variable to collect the OHLC data from each 4 day's of daily data like below.

    PHP Code:
    if (getBarState() == BARSTATE_NEWBAR && nCount == 1) {
        
    n4DayOpen open(0);
    }

    n4DayHigh highest(nCounthigh());
    n4DayLow lowest(nCountlow());
    n4DayClose close(0); 

    You could use this data to make decisions within your EFS. If you want to see this data visually on your chart, you could simply return the data to the chart in your return statement from main().

    PHP Code:
    function main() {
        ...  
    // your code

        
    return new Array(n4DayOpenn4DayHighn4DayLown4DayClose);

    Jason K.
    Project Manager
    eSignal - an Interactive Data company

    EFS KnowledgeBase
    JavaScript for EFS Video Series
    EFS Beginner Tutorial Series
    EFS Glossary
    Custom EFS Development Policy

    New User Orientation

    Comment


    • #3
      Jason

      Much obliged with the fast and knowledgable response ....

      I really appreciate the strategy you suggest and will try to implement an efs using your ideas

      Thanks Again
      Claude

      Comment

      Working...
      X