Announcement

Collapse
No announcement yet.

Multiple Time Frame Calculation

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

  • laxmicc
    replied
    Originally posted by LetUsLearn View Post
    Hello laxmicc,

    Below there's a link to some eSignal PDF Tutorials on eSignal's KnowledgeBase website. When you click on them you'll have to login to download them, but I didn't bother with that because I already have them. They also have an online version of them but when I clicked on the beginner tutorials, they all went to the same wrong website (Guide to Developing eSignal Graphics), so you can try the downloadable PDF's to see if that works out better. There are 4 beginner tutorials and 3 back testing tutorials, they were what I studied when I first wanted to understand how to use eSignal's EFS. The tutorials will help you understand the basics and that'll make things easier for you...like understanding how BARSTATE works.

    https://efs.kb.esignal.com/hc/en-us/...r-Tutorials?
    Hi LetUsLearn,

    Thank you very much for your help. Do you use automated trading functionality of eSignal too?

    Regards
    Lucky

    Leave a comment:


  • LetUsLearn
    replied
    Hello laxmicc,

    Below there's a link to some eSignal PDF Tutorials on eSignal's KnowledgeBase website. When you click on them you'll have to login to download them, but I didn't bother with that because I already have them. They also have an online version of them but when I clicked on the beginner tutorials, they all went to the same wrong website (Guide to Developing eSignal Graphics), so you can try the downloadable PDF's to see if that works out better. There are 4 beginner tutorials and 3 back testing tutorials, they were what I studied when I first wanted to understand how to use eSignal's EFS. The tutorials will help you understand the basics and that'll make things easier for you...like understanding how BARSTATE works.

    Leave a comment:


  • LetUsLearn
    replied
    Hello laxmicc,
    I’ve never used SetComputeOnClose(), I guess I’ve never seen a need. BARSTATE_ALLBARS occurs only once when preMain() gets called as the EFS starts to load the oldest bar. BARSTATE_NEWBAR occurs on the first tick of every bar and then waits to activate again on the first tick of the next bar, so if you want something to happen only once at the start of a new bar, this is what you should use. You could have code in the NEWBAR statement that would calculate whatever you want based on the previous bar.?

    Leave a comment:


  • laxmicc
    replied
    Originally posted by LetUsLearn View Post
    Hello laxmicc,

    As I try to explain below, when the bars are streaming with new data, the white SMA will always update with the current 5-minute SMA while the cyan SMA_P (Prior) will hold the prior 15-minute bar's 5-minute SMA. If the program is loaded on a 5-minute chart, the cyan SMA_P will hold the prior bar’s white SMA.

    The program's output in the Data Window can be validated on a 5-minute chart's SMA as follows:

    The SMA for 5-minute bar time = 15-minute bar's time + 10 minutes, so the SMA for 5-minute bar time 09:55 is equal to the white SMA for 15-minute bar time 09:45 when looking at any 5-minute bar index other than zero. When data is streaming (zero index) the white SMA on the 15-minute chart will be the same as the SMA on the 5-minute chart.

    SMA_P (Prior) for 5-minute bar time = 15-minute bar's time - 5 minutes, so the SMA for 5-minute bar time 09:40 is equal to the cyan SMA_P for 15-minute bar time 09:45 when looking at any 5-minute bar index.
    When you scroll the cursor back on a 15-minute chart, you will see that the cyan SMA_P will always equal the prior bar's white SMA, I did this so you could see that the cyan SMA_P is always the prior white SMA on the 15-minute chart. So, from 09:45 until 10:00, the cyan SMA_P will hold the same 5-minute SMA until the new 10:00 15-minute bar...that's 3 5-minute bars (15 minutes) will stream in before the cyan SMA_P updates again.

    LetUsLearn

    ?
    Thankyou so much for detailed explanation. I am very weak on technicals of efs about how to use functions precisely. If I dont want efs calculate every tick of new bar, what function to be used. BARSTATE_ALLBARS or BARSTATE_NEWBAR. I think BARSTATE_ALLBARS will calculate on everytick that is streaming. SetComputeOnClose(True) on preMain() completely discard the new bar and its tick data. I am calculating strategy based on previous bar and want to fire order on current bar but only once, unable to do it.

    Regards
    Lucky

    Leave a comment:


  • LetUsLearn
    replied
    Hello laxmicc,

    As I try to explain below, when the bars are streaming with new data, the white SMA will always update with the current 5-minute SMA while the cyan SMA_P (Prior) will hold the prior 15-minute bar's 5-minute SMA. If the program is loaded on a 5-minute chart, the cyan SMA_P will hold the prior bar’s white SMA.

    The program's output in the Data Window can be validated on a 5-minute chart's SMA as follows:

    The SMA for 5-minute bar time = 15-minute bar's time + 10 minutes, so the SMA for 5-minute bar time 09:55 is equal to the white SMA for 15-minute bar time 09:45 when looking at any 5-minute bar index other than zero. When data is streaming (zero index) the white SMA on the 15-minute chart will be the same as the SMA on the 5-minute chart.

    SMA_P (Prior) for 5-minute bar time = 15-minute bar's time - 5 minutes, so the SMA for 5-minute bar time 09:40 is equal to the cyan SMA_P for 15-minute bar time 09:45 when looking at any 5-minute bar index.
    When you scroll the cursor back on a 15-minute chart, you will see that the cyan SMA_P will always equal the prior bar's white SMA, I did this so you could see that the cyan SMA_P is always the prior white SMA on the 15-minute chart. So, from 09:45 until 10:00, the cyan SMA_P will hold the same 5-minute SMA until the new 10:00 15-minute bar...that's 3 5-minute bars (15 minutes) will stream in before the cyan SMA_P updates again.

    LetUsLearn

    ?

    Leave a comment:


  • laxmicc
    replied
    LetUsLearn, Thank you vary much. It is showing only 1 value in the bar replay too if 5 min resolution is used. Can I use this in a strategy of 15 min for confirmation of latest development in 5 min interval?

    Lucky
    [email protected]

    Leave a comment:


  • LetUsLearn
    replied
    Hello laxmicc,
    Below is a program that will do that for you.

    // If the time template is in auto, then only 300 bars load on a 15 min. chart and only 300 bars of data from a 5 minute
    // interval will be used to calculate the MA; a 15 bar 5 min. MA will first show up on the chart at index -95! If you
    // specify a time template like 5 days, then you'll get 5 days of data for both the 15 min. chart and the 5 min. MA.

    "use strict";
    var fpArray = []; // Global vars
    var xSMA_Inv5 = null;
    var nSMA_Inv5 = null;
    var nSMA_Inv5_Saved = null;

    function preMain(){
    setPriceStudy(true);
    setStudyTitle("Interval5_On_15Min");
    setCursorLabelName("SMA", 0);
    setPlotType(PLOTTYPE_SQUAREWAVE, 0);
    setDefaultBarFgColor(Color.white, 0);
    setCursorLabelName("SMA_P", 1);
    setDefaultBarFgColor(Color.cyan, 1);
    setShowSeries(false, 1); // Show series in data window but don't plot on chart.

    fpArray[0] = new FunctionParameter("nLength", FunctionParameter.INTEGER);
    fpArray[0].setDefault(15);
    fpArray[0].setName("MA_Length");
    fpArray[1] = new FunctionParameter("nInterval", FunctionParameter.INTEGER);
    fpArray[1].setDefault(5);
    fpArray[1].setName("MA_Interval");
    }

    function main(nLength, nInterval){
    if(getBarState() == BARSTATE_ALLBARS){
    xSMA_Inv5 = getSeries(sma(nLength, close(inv(nInterval))));
    }
    if(getBarState() == BARSTATE_NEWBAR){
    nSMA_Inv5_Saved = nSMA_Inv5;
    }
    nSMA_Inv5 = xSMA_Inv5.getValue(0);

    return [nSMA_Inv5, nSMA_Inv5_Saved];
    }?

    Leave a comment:


  • laxmicc
    started a topic Multiple Time Frame Calculation

    Multiple Time Frame Calculation

    Hello,

    If I am using 5 min interval sma in 15 min interval chart, is it possible to use only the values of 3rd 5 min sma for that particular chart interval for calculation in any strategy.


    Regards
    Lucky
Working...
X