fxDreema

    • Register
    • Login
    • Search
    • Back to the main page
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    1. Home
    2. Gilles
    3. Posts
    G
    • Profile
    • Following 0
    • Followers 0
    • Topics 20
    • Posts 46
    • Best 2
    • Controversial 0
    • Groups 0

    Posts made by Gilles

    • RE: Block to determine the minimum/maximum of a moving average ?

      @sktsec Oh, I just saw it now πŸ™‚ Thank you very much πŸ™‚

      posted in Questions & Answers
      G
      Gilles
    • RE: Block to determine the minimum/maximum of a moving average ?

      @sktsec I can't find the block that can help me do this, could you point me to it ?

      posted in Questions & Answers
      G
      Gilles
    • Block to determine the minimum/maximum of a moving average ?

      Which block should we use to determine the minimum/maximum of a moving average for a certain number of periods?
      Thank you for your response, with an example of block construction if possible πŸ™‚ !

      posted in Questions & Answers
      G
      Gilles
    • RE: Draw line object block to represent calculation on screen

      @l-andorrΓ  Yes, of course, I'll explain how it works to get the expected result.

      Example with a period of 10 (configurable).
      The idea here is to apply a weighting coefficient to each encountered price as we go back in time. Then we'll manipulate this data to get our result.

      In this example, we go back to progressively gather all the prices to multiply them by a weighting coefficient until we reach the closing price 10 periods ago.

      Objective = we're trying to determine the price of the current period.

      Step 1
      Determine each weighted price to add them up at the end.

      closing price of period-1 = 14973.54 * 1 = 14973.54
      closing price of period-2 = 14934.54 * 2 = 29869.08
      closing price of period-3 = 14919.04 * 3 = 44757.12
      closing price of period-4 = 14919.03 * 4 = 59676.12
      closing price of period-5 = 14933.02 * 5 = 74665.1
      closing price of period-6 = 14935.03 * 6 = 89610.18
      closing price of period-7 = 14958.52 * 7 = 104709.64
      closing price of period-8 = 14,975.04 * 8 = 119800.32
      closing price of period-9 = 14,974.52 * 9 = 134770.68
      closing price of period-10 = 14,974.03 * 10 = 149740.3

      Sum of weighted prices = 822572.08

      Step 2
      Add up all the weighting coefficients as follows:
      (1+2+3+4+5+6+7+8+9+10) = 55

      Step 3 = result = value of the price for the current period
      822572.08 / 55 = 14955.85

      That's it, so if you could help me model this with the blocks, that would be great.
      Thank you πŸ™‚ !

      posted in Questions & Answers
      G
      Gilles
    • RE: Draw line object block to represent calculation on screen

      Hi, i just need to know if an example exists to do it. Thank you for your answer.

      posted in Questions & Answers
      G
      Gilles
    • Draw line object block to represent calculation on screen

      I would like to draw a line using the charts and objects blocks to represent the following calculation on the screen:

        local i;
          local ii = Period;
          local LastPeriod;
      
          if period == source:size()-1 
          then
              LastPeriod = true;
          else
              LastPeriod = false;
          end
      
          while ii > 0 do
      
              if not(LastPeriod) 
              then
                  ii = 0;
              else
                  ii = ii-1; 
              end
      
              local Sum = 0;
              local SumW = (Period+2)*(Period+1)/2;
      
              for i=0,Period,1 do
      
                  Sum = Sum + (Period-i+1) * source[period-i];
      
                  if Redraw 
                  then
                      if i <= source:size()-1 - period and i > 0 
                      then
                          Sum = Sum + (Period-i+1) * source[period+i];
                          SumW = SumW + (Period-i+1);
                      end
                  end 
              end
      
              Line[period] = Sum / SumW;
      

      How can I do this ?
      Can you help me?

      Thank you πŸ™‚ !

      posted in Questions & Answers
      G
      Gilles
    • 1
    • 2
    • 3
    • 3 / 3