I have a column of data showing trade results - in the most basic way I can explain, as my account value GROWS by a preset amount (say 20-30%) how can I ADD to the number of contracts I am trading. For example I start with $10,000 and the account grows to $12,000 or 20% - according to my own trading rules, this allows me to ADD an additional contract to trade (I start with 1 contract). As the account continues to grow progressively 20% from the previous 20% jump, I add ANOTHER contract.
and to top this off, I do the same in reverse, If I lose or go into a drawdown .. how do I reduce my number of contracts traded?? so lets say I am up to trading 4 contracts and I lose say 10% of the account value - I want to slow down or "ease up" the number of contracts until I get the account back to its previous high. Anyone know how this can be programmed??
One last final caveat - when you go on a winning streak, I add for every 20% INCREASE in the account value and when I lose I reduce contracts at every 10% pullback to preserve winnings as much as possible.but I am ALWAYS allowed to trade a MINIMUM of 1 contract
I want to use 4 toggle buttons to be able to add and remove 4 different series to a chart. When the toggle button is clicked, a specific series is added to a chart, and when it is unclicked then the series would be removed.
The problem I am running into is that unless I add and remove each series in a specific order, I will get an error because I may be trying to remove a series whose series number is not on the series collection in the chart.
for example: if I remove series number 2 with the toggle button for that specific series, then the toggle button for series number 3 will remove the old series 4 (which is now 3), and the toggle button for series 4 won't work because series 4 will now have become series 3.
Therefore, would there be a way to remove a series based on the name of the series, rather than the series collection number?
I have problems with dynamically adding and removing checkboxes. I have a form and there is a button to add more rows to the table. Every row includes a checkbox too.
So first i add a row, and then add a checkbox to a specified cell in that row.There is a button for removing rows as well (witch should removes checkboxes as well).
My problem is when i ad the checkbox the linked cell property only works for the first one.When i add the second row the linked cell of the firstly added checkbox changes to the one in the new row and the new checkbox has no linked cell. I am adding the stuffs as follows:
VB: Private Sub addBtn_Click() Dim y As Integer y = findFunc("end") // Y define where To insert the New row Cells(y, 11).EntireRow.Insert Cells(8, 11).Copy
I'm trying to automatically add and remove one criterion from an autofilter without disturbing the previous existing criteria The autofilter code sounds like this:
How would I go about referring to this array and adding another item called "Hard" to any pre-existing elements in this array?
I plan on attaching this code to a button and use it as a filter, so when the button is pressed, the item will be added to the list of criteria, and if it is "un-pressed" the item will be removed.
I have this spreadsheet that I am creating schedules for my employees since our scheduling software at work is horrible to work with. It calculates total hours for each employee at the far right of the rows, and calculates total hours for each day in the columns. The formulas that calculate the hours for each day is set up to automatically deduct 30 minutes from a shift, for lunch, if they're scheduled for more than 5 hours (the gray shaded employee rows are for managers and that only deducts 30 mins if they're shift exceeds 8 hours).
I'm familiar enough to put somewhat complex formulas together, but I don't understand it enough to always make them work correctly. What I'm wanting to be able to do is add or subtract entire rows (add new employees or remove old), and have my formulas for calculating the total hours to still work. Right now if I delete a row the cell with the formula in it says #REF!. I can fix this by going through the formula and manually deleting everything in that contains those other cells, but the formula is huge, and it's pretty tedious going through the whole thing when it feels like there should be a simpler way of doing it.
TLDR: I want to be able to add/remove a row and have my cells currently on row 36 update the formula correctly.
It now requires a special chart, I am trying to replicate what this other program does, but is slightly corrupted and it's chart section does not seem to work on XP. The program was made in DOS so I can't provide a Print-Screen shot to show how it looks. If it gets too confusing describing the graph, I have to get XP to somehow run a DOS program correctly so the graph may appear to get a Print-Screen shot. The chart shows the "best 3" NEGATIVE rise in a progression and the rising lines are colored in red. If the other values are POSITIVE, it shows a fall in Blue. ( black background). So if the value of Item 1 is -17.5% and the next Item 2 is -12%, then the red line of Item 1 will show the highest.
BUT, it sort of follows the line back from the OVERALL percent values at the end of the calculation from the start of the first percent value, it's first entry. I have included a sample sheet, all I need to know if a progressive chart can be created with the way I have positioned the numbers, if not let me know how the numbers need to be positioned and it's simply a matter of me making a few changes in the workbook that processes the sums to suit. Finally, the amount of entries can be anywhere from 3 to 30, I have shown in the example 9 entries. The purpose is to show a progression of price changes using percents as the indicators.
I am running a sales spreadsheet that requires sales entered each day. I use a simple formula to run a continuous total starting at Monday and ending Sunday (1st cell for sales input is B4, second D4, third F4 and so on. 1st Cell for accumulated sales is C4, second E4 and third G4 and so on.
I use B4+D4 to caluculate the running total in E4 or example,and to eliminate that total appearing in G4 where the next formula is B4+D4+F4 I precede that with an IF formula IF(E4=0,'', ). This way I only show the current Week to date totals, not the upcoming days in the rest of the week. My problem lies in Holidays. If for instance D4, the Tuesday was a holiday and I enter either "holiday" or just leave it blank, the rest of the weeks formula will not work. I get a Value message. How can I achieve my goal of getting a daily week to date total without having it show in the upcoming days AND have a holiday in there too?
I came across the solution to this post - [URL] ..... - and was just wondering how to adjust the formula so that it calculates the correct tax starting from the net amount.
Say for example, an employee is paid a fixed, after-tax salary amount, and the employer is responsible for covering the tax - the salary payment needs to be "grossed-up" to calculate the correct amount of tax.
With 'tax brackets' as follows:
Taxable incomeTax on income (2011 – 2012)Tax rate $0 – $6,000Nil0% $6,001 – $37,00015c for each $1 over $6,00015% $37,001 – $80,000$4,650 plus 30c for each $1 over $37,00030% $80,001 – $180,000$17,550 plus 37c for each $1 over $80,00037% Over $180,000$54,550 plus 45c for each $1 over $180,00045%
The formula to calculate tax, starting from the gross amount, is:
Each row in Table 1 represents an "Expanded" array formula.
In Table 2 I have a "Running" formula to return progressive max values working Left to right.
My question is, can this be written as an array?
Returning something on these lines ... {(IF(B1="","",MAX($B1:B1))),(IF(C1="","",MAX($B1:C1))),(IF(D1="","",MAX($B1:D1))),(IF(E1="","",MAX($B1:E1))), etc.}
Drag B7 across and down to see what the array should contain for each row in Table 1
I have several series of 13 figures (from 0 to 20), such as :
000141833000001
I would like to filter those series with the following condition :
Each figure (except the zeros) should be higher or equal to the first figure (found on the right) which is not a zero.
In the example :
14 should be higher or equal to 18 : FALSE 8 should be higher or equal to 3 : TRUE 3 should be higher or equal to 3 : TRUE 3 should be higher or equal to 1 : TRUE
So, the serie is FALSE, due to the fact that 14 is not higher than 18.
The find value will always be the same...its just a placeholder that is randomly inserted. (currently i am using the value "Placeholder"). basically in column B i want to insert the iteration of the Place holder. the attached spreadsheet better illustrates what i am trying to do. starting the count at zero is kind of important, but not the end of the world if it is impossible.
I've got a problem involving several Dim'd Variables needing to be added up, they're all Dim'd as Variants though as they can be either strings or numbers at any time.
I need a formula (VBA) to add them up (to add their actual numeric values - not just a "1" if they contain a number) and ignore them all together if they contain string values.
I have a userform that I'm using to add data to a worksheet, with the following
Private Sub CommandButton1_Click() Dim OutSH As Worksheet Set OutSH = Sheets("Sheet1")
OutSH.Cells(nextrow2, 1).Value = Surname.Value OutSH.cells(nextrow2,2).value = ID.value OutSH.cells(nextrow2,3).value = Date.value ...... I need to ensure that duplicate entries are not made for the same person on the same date. The ID is unique to each person.
IF statement that can check for a duplicate and then come up with a dialouge box with some custom text, and then exiting the sub?
I am trying to add numbers from cells if it IsNumeric and for some reason in column K the macro doesnt recognize numbers after row 14?
The range column is "E4:E" Search criteria is the letter "R" in column "E" Then using OffSet, I go thru other columns and process data. Most of the macro works except for column K after row 14?
I have a formula in a workbook that keeps giving me #DIV/0! no matter what I do. I am trying to total up a column of numbers. If I enter into B28 the following formula : =SUM(D4*E4)+(D5*E5)+(D6*E6)+(D7*E7)+(D8*E8)+(D9*E9)+(D10*E10)+(D11*E11)+(D12*E12)+(D13*E13)+(D14*E14 )+(D15*E15)+(D16*E16)+(D17*E17)+(D18*E18)+(D19*E19)+(D20*E20)+(D21*E21)+(D22*E22)+(D23*E23)+(D24*E24). it does not give me the #DIV/0! but the result is incorrect.
what I need is a formula that totals rows 4 through 24 but the formula for each row individually would be =(d4/b4*e4) but I am trying to avoid having to add multiple extra columns (& clutter) for each item in each row that I need to calculate. I have attached the workbook so that you can see what I am trying to do.
So I created a custom Add-In, but the add-in isn't removing itself when I uninstall it or when I close the program (this creates an error in saving files, so all files are getting corrupted)
This is all the code I have running the menu bar and I can't figure out the proper closing code
I am trying to organize some meteorological data for a project and I ran into a wall, basically I have 3 columns in one there is the date, in one the hour and in the third one the temperature the issue is that in the hour section i have the hour 12:00 that repeats its self , and this goes for the hole year , pretty much every day i have the hour 12:00 that repeats twice , so select for every Monday , Tuesday etc only certain hours.
I have list of data references about 60000 of them but some are duplicated. I have used advanced filted then unique records only. So now i have just the unique records showing now. How do i copy the accounts that is just unique into a new worksheet? I tried copying it but its copying everything. I even tried using paste value but still copying everything?
I have some cells full of user entered information that has returns in it, so that it's multiple lines long. What's the best way to remove returns from a string?
It seems like I am asking a question at least once a day. I searched the net and forums and could not find an answer to this question. Thanks to everyone for the help I am making a lot of progress because all of you. Basically, I have a read-only workbook which the user gets a prompt to save as a new workbook for editing purposes. I have a autorun macro so now when the user opens their workbook, it contains my autorun macro. I do not want this. Is there a way to remove modules so that the users copy has no macro information?