NexusFi: Find Your Edge


Home Menu

 





Excel Help with calculating averages with custom input


Discussion in Psychology and Money Management

Updated
      Top Posters
    1. looks_one RM99 with 8 posts (1 thanks)
    2. looks_two vegasfoster with 4 posts (4 thanks)
    3. looks_3 DAYTRADERPROFESIONAL with 2 posts (0 thanks)
    4. looks_4 redratsal with 1 posts (1 thanks)
    1. trending_up 3,021 views
    2. thumb_up 6 thanks given
    3. group 3 followers
    1. forum 15 posts
    2. attach_file 2 attachments




 
Search this Thread

Excel Help with calculating averages with custom input

  #1 (permalink)
 RM99 
Austin, TX
 
Experience: Advanced
Platform: TradeStation
Trading: Futures
Posts: 839 since Mar 2011
Thanks Given: 124
Thanks Received: 704

I'm trying to take a column of values and calculate a simple moving average.

So if the first column is the values, and I want to calculate the 20 MA, then I go to the 20th value and in Column B I put "=SUM(A1:A20)/20"

I then copy and paste this all the way down to the end of the column to get the 20 MA values for the data.

This is probably a crude approach.

How do I craft it so that the MA setting is a reference cell that I can place different inputs?

Essentially, how do I use the reference cell to complete the row portion of the SUM() function?

"A dumb man never learns. A smart man learns from his own failure and success. But a wise man learns from the failure and success of others."
Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
How to apply profiles
Traders Hideout
REcommedations for programming help
Sierra Chart
Increase in trading performance by 75%
The Elite Circle
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
Trade idea based off three indicators.
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
33 thanks
Tao te Trade: way of the WLD
24 thanks
My NQ Trading Journal
14 thanks
HumbleTraders next chapter
11 thanks
GFIs1 1 DAX trade per day journal
11 thanks
  #3 (permalink)
 
redratsal's Avatar
 redratsal 
Milan (I)
 
Experience: Advanced
Platform: Ninjatrader
Broker: Kinetick
Trading: FDAX,6E,CL,YM,NQ,ES
Posts: 1,648 since Oct 2010
Thanks Given: 1,215
Thanks Received: 2,090


Instead of building the formulas try Technical Indicators with TA-Lib and, 89 TA indicators excel addins and it's free.

Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #4 (permalink)
 RM99 
Austin, TX
 
Experience: Advanced
Platform: TradeStation
Trading: Futures
Posts: 839 since Mar 2011
Thanks Given: 124
Thanks Received: 704


redratsal View Post
Instead of building the formulas try Technical Indicators with TA-Lib and, 89 TA indicators excel addins and it's free.

Thanks, I'll check it out. I'm using Tradestation so I'm not sure if that'll work.

Aside from that, I'm not averaging from the chart, but outputs on the performance report for trade information. I have to manually modify excel printouts, because referencing trade information in Easy Language is a mystery to me.

"A dumb man never learns. A smart man learns from his own failure and success. But a wise man learns from the failure and success of others."
Started this thread Reply With Quote
  #5 (permalink)
 vegasfoster 
las vegas
 
Experience: Intermediate
Platform: Sierra Chart
Broker: Velocity/IB
Trading: 6E
Posts: 1,145 since Feb 2010
Thanks Given: 304
Thanks Received: 844

Assuming data starting in E1, average calculation starting in F1, and parameter in G1, formula compatible with all versions would be

=IF(ISERROR(AVERAGE(INDIRECT(("E"&ROW(E1)-$G$1+1)):E1)), "",AVERAGE(INDIRECT(("E"&ROW(E1)-$G$1+1)):E1))



Can also use IFERROR on newer versions.

Reply With Quote
  #6 (permalink)
 RM99 
Austin, TX
 
Experience: Advanced
Platform: TradeStation
Trading: Futures
Posts: 839 since Mar 2011
Thanks Given: 124
Thanks Received: 704


vegasfoster View Post
Assuming data starting in E1, average calculation starting in F1, and parameter in G1, formula compatible with all versions would be

=IF(ISERROR(AVERAGE(INDIRECT(("E"&ROW(E1)-$G$1+1)):E1)), "",AVERAGE(INDIRECT(("E"&ROW(E1)-$G$1+1)):E1))



Can also use IFERROR on newer versions.

You're awesome. Thanks...I'm running into all sorts of problems. My server doesn't have Excel, so I have to export in .mht format, which includes all the other data in the spreadsheet. So copying and pasting is a challenge to begin. THEN, if that weren't enough, I have to try to pull out data that skips rows, and I haven't been able to figure out how to paste with it skipping the blank rows. I click on paste special and check the block that indicates skip blanks, but it still pastes.

"A dumb man never learns. A smart man learns from his own failure and success. But a wise man learns from the failure and success of others."
Started this thread Reply With Quote
  #7 (permalink)
 RM99 
Austin, TX
 
Experience: Advanced
Platform: TradeStation
Trading: Futures
Posts: 839 since Mar 2011
Thanks Given: 124
Thanks Received: 704

Vegas,

Many thanks for the help. The forumula is working...partially. It's working fine to adjust the start based off the MA input (if I input 5, it starts filling values at the 5th row, if I put in 20, it starts filling values at row 20) however, the calculations are not outputting proper averages. I'm scratching my head....because it's verbatim what you posted, and yours is calculating fine.

"A dumb man never learns. A smart man learns from his own failure and success. But a wise man learns from the failure and success of others."
Started this thread Reply With Quote
  #8 (permalink)
 vegasfoster 
las vegas
 
Experience: Intermediate
Platform: Sierra Chart
Broker: Velocity/IB
Trading: 6E
Posts: 1,145 since Feb 2010
Thanks Given: 304
Thanks Received: 844

I may not be understanding what you are trying to do, because if you enter 20 then why you would want to calculate on anything less than 20? Apart from that, I double checked that the averages are calculating correctly on mine, so can you post your file so I can look at it?

Reply With Quote
  #9 (permalink)
 RM99 
Austin, TX
 
Experience: Advanced
Platform: TradeStation
Trading: Futures
Posts: 839 since Mar 2011
Thanks Given: 124
Thanks Received: 704


"A dumb man never learns. A smart man learns from his own failure and success. But a wise man learns from the failure and success of others."
Started this thread Reply With Quote
  #10 (permalink)
 RM99 
Austin, TX
 
Experience: Advanced
Platform: TradeStation
Trading: Futures
Posts: 839 since Mar 2011
Thanks Given: 124
Thanks Received: 704


Not sure why the row and column markers didn't come through, but the status bar is hilighted on cell B5 (the first value in the 2nd Column...column B).

I've scratched my head, because I can see the IF (logic) operator and I'm pretty sure I'm understanding the convention logic...it's saying..."IF the value is null, then output "" (blank)" if the value is not null, then output the average of ......Column A, then it calculates the start row, and the end row.

But I can't even reverse engineer where it's getting the value. I've tried to see if it's averaging the wrong set of values, if it's cutting the average sample short, or adding extra...etc.

I'm really scratching my head.......but the convention is working swimmingly, if I put 20 into the input cell, it begins populating values at B20 (and leaves B1 through B19 blank) it's just giving me the wrong output values.

"A dumb man never learns. A smart man learns from his own failure and success. But a wise man learns from the failure and success of others."
Started this thread Reply With Quote




Last Updated on July 31, 2012


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts