Jump to content
Medved Trader Forums

Thebattlefront

Members
  • Posts

    75
  • Joined

  • Last visited

  • Days Won

    1

Thebattlefront last won the day on October 17 2022

Thebattlefront had the most liked content!

Reputation

1 Neutral

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Mike, So i understand that queue[3] = 2 should work now, but is it also possible to do queue[3]= queue[3] + 2? So I can make a cumulative sum inside only one of its cells. Also, can i do lets say, queue[5] = queue[4] / queue[2] or queue[5] = queue[4] * queue[2] Is division and multiplication allowed like that? And also, can i do math operations like queue[10] = Math.Round(queue[4] / queue[2], 2);
  2. I meant to write QLAtrPerBarSum.[5] not Q.LAtrPerBarSum[5]. The period is too soon. I also checked the medved help center, it doesn't appear like this operation would work. What do you mean by the save and restore functions? Are you referring to the currentstate and savestate functions? Or are you referring to something else? Edit: I just want to clarify what exactly I'm looking for. I just want to be able to create an array of variables, up to 20, and be able to do basic operations on individual cells in that array - addition / subtraction / multiplication etc. And I want to save that array somewhere so when the scan runs the next candle, that information is not lost. Is there any way to do that. Or do you think I have to separate each cell in that array into it's own currentstate variable and then perform the operations that way. This is the way I've been doing it before, but it's really really ugly to look at the code for it. It's just these long lines of declaring these current state variables and then I have to repeat the codelines for the same function 20 times for each candlestick pattern in order to assign the values I need to all of the individual currentstate variables i've declared. It really looks terrible. That's why I'm trying to figure out an array solution. It would look so much nicer and cleaner to implement.
  3. Is it possible to reference a value in stateFIFOqueue array (e.g.Q.LAtrPerBar[5]) and then replace that value with Q.LAtrPerBar[5] + E; where E is a double? Is it possible to call an individual cell's value inside the array like that, and then add some value to itself? So the code line would look something like Q.LAtrPerBarSum[5] = Q.LAtrPerBarSum[5] + E; By the way just so it's clear, "AtrPerBar" is my "unit" for expressing profit. ATR = average true range. I use ATR instead of percentages because some stocks move faster than others and so the percentage swings can be much larger than others so it's harder to normalize a system around that. So instead i use ATR because most stocks have price swings that are relatively similar to their average true range value. Just so you aren't confused. So this codeline would be adding another data point of profit to the total "profit" of the candlestick pattern it is measuring. That's why i have to reference the cell value again and then add E. E is the latest profit to be added to the total sum. E is also expressed in units of ATR per candlestick bar, as the total sum is too.
  4. Do you have any idea how I can change the value of a cell in a CurrentState array, by referencing itself and adding another value to it? Or do i have to switch back to individual currentstate variables and abandon the idea of keeping the data stored in a single array altogether? I remember before you showed me how to use the StateFIFOQueue to add data to a set, and then perform operations on that set (like getting the average) to get the important values i can use. So i know there are alternatives to using just a bunch of individual currentstate variables to hold the values. But I just don't know what those alternatives are.
  5. Thanks Mike. Yeah i just want these arrays to store the data from the trades. Much like using individual currentstate variables and labelling them each CurrentState.m_dS1AtrPerBar, CurrentState.m_dS2AtrPerBar, CurrentState.m_dS3AtrPerBar, etc. but using just a single array for all to make it cleaner. Can i ask , what did you change? My results still look like this: Edit: The idea here is that each letter represents a different candlestick pattern. And what im doing is tracking the profit / number of trades / winrate of each candlestick, for each stock on my watchlist. That's what all the zeroes and the 1, 2, 3, 4, 5 numbers are in each column. They -should- be tracking the profit, tradecount, etc but i just get a bunch of zeroes.
  6. By Update I mean, I'd like to add a value to the last cell value to get a running sum of the total amount of profit my system has made up until the current point. So, for trade 1 it has a total sum let's say P, then the next trade's profit will add E to it and therefore the code line should look soemthing like P = P + E; where P is the value of the cell inside the currentstate variable array and E is just some double constant that im adding to P.
  7. Hi, I'm having a lot of trouble updating the values inside a public double[] CurrentState variable. The code looks something like this: public double[] m_dLAvgAtrPerBarList; public double[] m_dLAvgAtrPerTradeList; public double[] m_dLTradeCountList; CurrentState.m_dLAvgAtrPerBarList = new double[20] {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20}; CurrentState.m_dLAvgAtrPerTradeList = new double[20] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; CurrentState.m_dLTradeCountList = new double[20] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; CurrentState.m_dLAtrPerBarSumList[CurrentState.m_iPatternIndex] = CurrentState.m_dLAtrPerBarSumList[CurrentState.m_iPatternIndex] + m_dAtrPerBar; CurrentState.m_dLAtrPerBarAvgList[CurrentState.m_iPatternIndex] = Math.Round(CurrentState.m_dLAtrPerBarSumList[CurrentState.m_iPatternIndex] / CurrentState.m_dLTradeCountList[CurrentState.m_iPatternIndex], 0); The point of this is to update the Total Sum of the Trade profits in the ATRPerBarSumList Currentstate array. And then divide this sum by the number of trades to get the average profit I can expect for each trade using this system. The problem is, my code never updates any of the values inside the arrays. It remains at all zeroes or just 1, 2, 3, 4, 5... like in the first array I typed (i was just checking to see if it would contain a value other than zero). How do i update the cell values inside these current state arrays? It feels like im missing something really basic but i dont know what it is.
  8. Mine doesn't have that, it looks like this. Let me try updating. It still doesn't have that even after updating. That is really odd. OH i dont have it set to line. Ok my bad. Thank you Jerry!
  9. I've tried looking but I can't find it. Can you give me a screenshot? The options tab on the historical and intraday charts doesn't have a "color-code price line" option for me, and I tried using the search function for "color-code" but it doesn't return any result.
  10. Hi Jerry and Mike, I was wondering if there was a way to get medved to use a yellow line for the Line Chart on the daily, like it does for the intraday chart. It always reverts to a red/green line instead of the yellow one. I know I can set the candle up and candle down to yellow, but i was just wondering if there was another way.
  11. Hi, i had a quick question. Is there anyway to delete a layout from the layout dropdown menu? I deleted the files from the Medved Trader folder, but it still shows in the menu. See below.
  12. Hi, I was wondering if there was a way to convert a string into a PBShape variable. For example, if we had: string ShapeValue = "Star"; ShapeValue.ToPBShape(); would make ShapeValue change from string "Star" to PBShape.Star. And I could use that variable for printing purposes.
×
×
  • Create New...