Announcement

Collapse
No announcement yet.

Tick interval for multiple symbols

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

  • Tick interval for multiple symbols

    Hi guys,

    I tried to find the spread between 2 symbols every tick.

    If i set 1 of the symbols as "main symbol" i can get the prices of the other symbol just when the main symbol move, and i need every movement of each symbol.

    I tried to set the both symbols on the chart and i added the studies, the interval was fine but the data of the studies was just from the main symbol.

    How can i fix it??

    Thanks,
    Tal

  • #2
    efs with ticks

    Hi,

    I want to calculate the average of 60 last ticks between the spread of 2 symbols and to see it on the separate window...(1T interval..)

    The problem is when the symbol have more than 1 tick in sec or less than..it's return series object..i think..

    I just tried to see what is the value of (
    Code:
    close(-1,sym("SYMBOL1,1T");
    )...and it's incorrect...looking like series number..

    I would like to know how can i get the correct prices of the previous ticks.. (if the price didn't changed the price should be the last tick..or if the prices was changed more than 1 ticks i want to get all the ticks by the bar...(-1,-2,-3 etc..))

    And i need the time of each tick...although if i will have a solution for the prices i Guess it's will be a solution for the time as well...

    Example of my code:

    Code:
    debugClear();
    
        function preMain()
    {
        setPriceStudy(false);
        setStudyTitle("Average_1T");
    }
    
    
        function main()
    {
        
        var sma1=0;
        var sma2=0;
        var sma_t=0;
        
        var avg=0; 
        var avg1=0;
            
         
        for (var ix=0; ix>-60; ix--)
        {
        sma1=close(ix,sym("SYMBOL1,1T"));
        sma2=close(ix,sym("SYMBOL2,1T"));
        sma_t=sma2-sma1;
        avg=avg+sma_t;
        }
        avg1=avg/60;
    
        
        return avg1;
    
    }

    Comment


    • #3
      it is 2 different questions...someone can helpp????

      Comment


      • #4
        Hello Tal,

        I'm not sure I understand exactly what you're asking. But, if you're only looking for the spread betwen two symbol wouldn't it be easiest for you to use a spread symbol or the expression of the two symbols (MSFT - YHOO). This would give you the tick value based on each tick that happens between the two symbols. Though you would not be able to use a tick type chart (i.e. Tick, Second, Range or price type charts).


        Thank you,
        AveryH
        eSignal Support


        Originally posted by kakunt View Post
        Hi guys,

        I tried to find the spread between 2 symbols every tick.

        If i set 1 of the symbols as "main symbol" i can get the prices of the other symbol just when the main symbol move, and i need every movement of each symbol.

        I tried to set the both symbols on the chart and i added the studies, the interval was fine but the data of the studies was just from the main symbol.

        How can i fix it??

        Thanks,
        Tal
        Last edited by eSignal_AveryH; 06-10-2015, 12:05 PM.

        Comment

        Working...
        X