Jump to content
Medved Trader Forums

nasdorq

Members
  • Posts

    86
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by nasdorq

  1. I removed the line: var TS = GetTradingSessionInfo(DateTime.UtcNow); However, then I get an error for the 3rd line: The name 'TS' does not exist in the current context.
  2. Thank you Mike. Quick follow up if you have a moment? I replaced both GetTradingSessionInfo(Timestamp); with GetTradingSessionInfo(DateTime.UtcNow) in bold below. It seems to work, only plotting current day, and starting 10min after the session open. Though do I need to have that line twice? Perhaps I do since I'm trying to do two different things? public void MainCalculation() { TradingSessionInfo session = GetTradingSessionInfo(DateTime.UtcNow); var TS = GetTradingSessionInfo(DateTime.UtcNow); if (Timestamp[0]>=TS.SessionStart.AddMinutes(10) && Timestamp[0]<=TS.SessionStart.AddHours(6.5)) //plot 10 min after session open until close if (DateTime.UtcNow<session.DayStart.AddDays(1)) // only plot current day {
  3. The code wasn't appearing in the post so I had to attach a screenshot
  4. I'm trying to plot a paintbar for the current session only, and starting 10 minutes after the session open. I have a snippet of code for each, and I've combined them together. However it looks like there's probably some redundancy there, and I'm not sure how to simplify it. I figured since I run it on a lot of charts, it might be worth fixing. Do you have any suggestions?
  5. I have a question about scaling with multiple paintbars. I've attached a chart to show my issue. The chart symbol is MSFT (red line), along with two paintbars (green and blue lines). They are all squiggly lines, however because the prices are so different, the scaling makes them appear as horizontal. I see with indicators there is an option to adjust the scale, but I don't see it for paintbars. My two questions: 1) If I'm looking to overlay and compare two paintbar lines, is there a way to adjust the scaling and bring them in line? 2) Is there a way to ignore the scale of the chart symbol, and have the chart instead scale just around a paintbar? I tried the option of hiding the primary chart, which makes the price bars disappear, however the chart scale still has to include the primary chart, which again leads to compressed lines if the paintbar has a high value. Thanks
  6. I was getting an "inaccessible due to it's protection level" error, so I put "public" in front of "int Boom;" and it worked. You suggested setting the state variable to 99999, which I'm not sure where to put, but it seems to work anyway. Thanks again. I posted the full code of my original example idea in case it helps anyone. private void PaintbarInitialize() { } private struct PaintbarState { public int OutsideBar; public int InsideBar; } private PaintbarState CurrentState; private PaintbarState SavedState; private void PaintbarClearState() { CurrentState = new PaintbarState(); } private void PaintbarSaveState() { SavedState = CurrentState; } private void PaintbarRestoreState() { CurrentState = SavedState; } public void MainCalculation() { if (High>High[1] && Low < Low[1]) { CurrentState.OutsideBar = 0; } else { CurrentState.OutsideBar++; } if (High<High[1] && Low > Low[1]) { CurrentState.InsideBar = 0; } else { CurrentState.InsideBar++; } if (CurrentState.OutsideBar < CurrentState.InsideBar) { SetColor(Color.Green); } }
  7. Thanks Mike for the tip. I put together most of it, but I'm not quite sure how to declare a state variable called Boom. I googled but didn't find any good examples. What I have is below: public void MainCalculation() { //declare state variable Boom; if (High>High[1] && Low < Low[1]) { CurrentState.Boom = 0; } else { CurrentState.Boom++; } if (CurrentState.Boom > 5) { SetColor(Color.Green); } }
  8. Hey guys, Recently I inquired about the possibility of a "Bars Since True" looping function, where it reports the # of bars since a particular chart event, which I guess would be a timespan data type. In case it wasn't on the todo list, I figured I would ask if there is a way to do it without the simplified looping function? I have snippets from other loops, and in a previous thread the "Ago" was mentioned, but I can't seem to put it together. One use would be to compare the recency of particular chart events, for example: If Bars since "Outside bar (engulfing)" > Bars since "Inside bar" { SetColor(Color.Green); }
  9. The code didn't post initially. I had to copy to a notepad file and then copy/paste as plain text.
  10. i created a cumulative $TICK paintbar if anyone is interested. It uses the Compare Symbol indicator, so the underlying chart doesn't have to be the $TICK itself. I have two calls for SessionInfo, which could maybe reduced to one somehow. Thanks to Jerry and Mike for creating the loop functions. public void MainCalculation() { var TT = GetTradingSessionInfo(Timestamp); TradingSessionInfo session = GetTradingSessionInfo(Timestamp); TimeSpan TS = (Timestamp[0] - session.SessionStart); // number of minutes into session int p = (int) TS.TotalMinutes; // convert Timespan to integer if (DateTime.UtcNow<TT.DayStart.AddDays(1)) // only plot current day { SetColor(Color.Black); SetYValue(Sum(p,TICK)); //plots a running total using the Sum loop function } }
  11. Just wanted to throw the idea out there for the ability to have indicators like moving averages, vwap etc appear behind the price candles, as they can with draw objects. I made the indicator lines thicker so they're easier to read, but sometimes they overlap the tops/bottoms of bars. For equities charts with only RTH, the vwap vertically covers a sizeable portion of the opening candle.
  12. Tiny feature request. The list of shapes in the paintbar indicator has a bunch of symbols and letters. It might be helpful for some if there were some numbers in there, even 0-10. A number could display how many bars back a recent event occured, or maybe as an aid for recommended trade size based on chart volatility, etc.
  13. Thanks for the example above Jerry, for only getting an alert once per bar. If I could post a quick follow up. I tried to implement it but I didn't do it properly. For simplicity, it's an alert when the high > prior bars high. I'm using the method where if the result is false, to end the code using "return", and therefore keep going if it's true. public void MainCalculation() { { if (High <= High[1]) return; } { if (LastTriggeredTimestamp != Timestamp) { SetColor(SysColor.MainIndicator1); TriggerAlert("dalert", @"dmessage"); LastTriggeredTimestamp = Timestamp; } } } The error I get is : The name 'LastTriggeredTimestamp' does not exist in the current context. I get it for Pos 8,13 and 12,13. Do you know what I'm doing wrong? edit: I can't seem to post normally so I had to remove formatting
  14. One idea might be a trigger "once per bar" setting. Currently if a trader wants this, they could set the clearing time to the same # of seconds as the current timeframe. However, it becomes difficult if a trader frequently changes the timeframes on their charts at different times of the day, or if they simply have a lot of charts with varying timeframes. Once per bar means everything is constant, regardless of the chart timeframe.
  15. Just thought I'd throw a couple ideas out there that relate to paintbars. 1) Audio alerts for paintbars 2) Being able to create the same type of alerts we can with paintbars, but instead of only having them for charts, also be able to apply them to a list of symbols. I've seen it elsewhere, where it looks like a grid/spreadsheet. Symbols on the left, Names of Alerts along the top columns. When an alert triggers for a certain symbol, the cell flashes.
  16. Yes. The allocation methods are specified in TWS. Then when you buy/sell in the master account, TWS makes sure the sub accounts have the proper position size based on the allocation method. TWS has the ability to display the total position size for all sub-accounts. If you ever wanted to play around with an advisor demo, I could give you my paper trading account login.
  17. When connecting with an IB advisor, MT recognizes the master account (F account) as well as the sub-accounts (U account). In IB, the master account is used for order execution, and the shares are automatically distributed to the sub accounts. The master doesn't actually contain the positions. When chart trading is enabled in MT, normally a user can see the position size and price on the chart. However, because the master account doesn't hold positions, no positions are shown on the chart. If a sub-account is selected in MT for chart trading, that particular sub-accounts positions are shown. However, that would mean that MT trade orders would be sent to just that sub-account, when all trades are supposed to be executed through the master, to maintain proper allocation size between sub accounts. It might be helpful for anyone with IB advisors who uses MT, to be able to select the master account as the account for placing trades (works now), but also be able to see the positions on the chart as an aggregate of the sub accounts. Perhaps all U accounts that come from a single instance of IB (would have the same socket port #) could be grouped somehow. Not sure if it's doable, or would be of interest. Just thought I'd throw it out there as an idea.
  18. I may be wrong, but I seem to remember with Quotetracker, there was a filter so that for large volume prints, the entire volume bar wouldn't necessarily be shown. The problem with a large volume print, whether it's in a stock or something else, is that it expands the volume scale to fit the entire volume bar, which makes all other volume bars too small to read, until that bar is off the visible part of the chart. It might be helpful to have some kind of filter for this.
  19. I was looking around the ability to set custom chart period/frequency keyboard short cuts. Right now Ctrl + 1 = 1min, CTRL + 2 = 3min, etc. Its not a major feature, but it might be nice for the user to be able to change the period/frequency that these numbers load. Just thought I'd mention.
  20. In the past I've seen platforms that have tabs which allow the user to arrange groups of charts, and then flip through them. For example, one page for ETFs, another for commodities, another for indices, another for certain stocks etc. Having a tab allows you to quickly go to a certain pre-set group of charts, and also saves screen space. Currently the only way it seems doable is to save and load different layouts, though this doesn't like the quickest and most efficient way of doing this, especially since it would be closing and opening other charts/windows on other screens that a user would prefer to be constant. I'm not sure how such a feature would work with free floating charts, as opposed to having a bunch of charts confined to a parent window. But I just thought I would throw it out there.
  21. I've set the default order type to MKT in Settings....Trading....Accounts...Order Settings. However, if I press CTRL+2 for a buy order, it is still a limit order. Is this by design? It would be handy to be able to press CTRL+2, scroll the mouse wheel for the share size, and then click again to transmit the order.
  22. I remember seeing in another program, where the volume by price horizontal bars are adjusted if you scroll back a chart. For example, if the session is over, but I scroll the chart back to mid-session, the Vol by Price will appear as it would have appeared at that time. It's helpful for studying and developing strategies based on volume profile, but doing it after hours. As it is now, once the session is over, the indicator values are set. Just thought I'd throw it out there.
  23. Just an idea for those who use the candle countdown on charts. Perhaps there could be an option to have an audio alert when it reaches zero, and/or a visual alert on the chart. It's a very minor feature, but just thought I'd throw it out there in case anyone else was interested also.
  24. https://www.dailyfx.com/forex/education/trading_tips/post_of_the_day/2013/12/09/How_to_Use_Fibonacci_Expansions.html My apologies, I got my terminology wrong. You are right, extensions are based on the same 2 points used in calculation retracements. What I meant was expansions. In case you're not familiar with them, here is a link that describes it. In the 1st chart you can see the move from points 1 to 2, and the pullback being point 3. The 2nd chart shows the projected targets based on fibonacci numbers from point 3. The Profit Target #2 is 1.000 (100%) and equals the move from point 1 to point 2, which is then added to point 3.
  25. Some chart platforms allow for fibonacci extensions, which allow traders to plot measured moves (100% extensions). The drawing is like the retracement, where you click point A (beginning of move) and hold while you drag and let go at point B (end of move). But from there, you click on the point of the pullback (point C), and then the desired extensions are plotted. Also, this is unrelated, but an option to have indicators and/or trendlines be able to appear behind bars/candles might appeal to some users.
×
×
  • Create New...