Jump to content
Medved Trader Forums

Arg

Members
  • Posts

    171
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Arg

  1. Arg

    DXFEED

    Yes, TDA fills are not very good. But good to know I can switch to a faster feed (to avoid the frequent morning lag with TDA).
  2. Arg

    DXFEED

    If I am trading with TDA and using the TDA data feed will any lag in the TDA data feed also mean that there is a corresponding lag in any buy/sell orders sent to TDA? In which case using a faster data feed might not be very useful.
  3. Thanks Mike. I will take a look at the StateFIFOQueue over the Christmas period
  4. Thanks Mike. The BO code is just inputting a BarsTotal value to set number of bars, eg 15, and giving a trigger if the current bar is the max out of the previous 15 bars. It works but I want to add a volume condition - that is what is giving me trouble.
  5. I want to put together a portfolio spike scan and a breakout scan: Pasted below is what I've got so far. The spike scan and BO scan both work separately. Put together (as below) only the BO scan results appear in portfolio. How do I get the spike alerts to also appear? Also, for the spike scan the 11 length (bar) array is specified explicitly. Is it possible to change the spike code below to use "period" parameter to set the array length to any desired value, i.e. so I can set number of bars to eg 16. I tried to change the BO indicator to also include a volume condition. It doesn't work - how can I correct this? if (Max(BarsTotal,Close) == Close) && BarVolume[1]>15000 public void MainCalculation() { DefinePaintbarParameter("Period","Period",true, 2, 100, 1, 11); var lvca0 = Math.Log(Close[1]/Close[2]); var lvca1 = Math.Log(Close[2]/Close[3]); var lvca2 = Math.Log(Close[3]/Close[4]); var lvca3 = Math.Log(Close[4]/Close[5]); var lvca4 = Math.Log(Close[5]/Close[6]); var lvca5 = Math.Log(Close[6]/Close[7]); var lvca6 = Math.Log(Close[7]/Close[8]); var lvca7 = Math.Log(Close[8]/Close[9]); var lvca8 = Math.Log(Close[9]/Close[10]); var lvca9 = Math.Log(Close[10]/Close[11]); var lvca10 = Math.Log(Close[11]/Close[12]); double[] LogValCloseArray = new double[11] {lvca0, lvca1, lvca2, lvca3, lvca4, lvca5, lvca6, lvca7, lvca8, lvca9, lvca10}; double CloseArrayAverage = LogValCloseArray.Average(); double CsumOfSquaresOfDifferences = LogValCloseArray.Select(val => (val - CloseArrayAverage) * (val - CloseArrayAverage)).Sum(); double SDevClose = Math.Sqrt(CsumOfSquaresOfDifferences / (LogValCloseArray.Length - 1)); var m = SDevClose * Close[1]; var pricespike = (Close-Close[1])/m > 3; var lvva0 = Math.Log(BarVolume[1]/BarVolume[2]); var lvva1 = Math.Log(BarVolume[2]/BarVolume[3]); var lvva2 = Math.Log(BarVolume[3]/BarVolume[4]); var lvva3 = Math.Log(BarVolume[4]/BarVolume[5]); var lvva4 = Math.Log(BarVolume[5]/BarVolume[6]); var lvva5 = Math.Log(BarVolume[6]/BarVolume[7]); var lvva6 = Math.Log(BarVolume[7]/BarVolume[8]); var lvva7 = Math.Log(BarVolume[8]/BarVolume[9]); var lvva8 = Math.Log(BarVolume[9]/BarVolume[10]); var lvva9 = Math.Log(BarVolume[10]/BarVolume[11]); var lvva10 = Math.Log(BarVolume[11]/BarVolume[12]); double[] LogValVolumeArray = new double[11] {lvva0, lvva1, lvva2, lvva3, lvva4, lvva5, lvva6, lvva7, lvva8, lvva9, lvva10}; double VolumeArrayAverage = LogValVolumeArray.Average(); double VsumOfSquaresOfDifferences = LogValVolumeArray.Select(val => (val - VolumeArrayAverage) * (val - VolumeArrayAverage)).Sum(); double SDevVolume = Math.Sqrt(VsumOfSquaresOfDifferences / (LogValVolumeArray.Length - 1)); var n = SDevVolume * BarVolume[1]; var volumespike = (BarVolume-BarVolume[1])/n > 3; var scan = pricespike && volumespike && BarVolume[1]>15000; SetScanResult(scan); if (scan) { SetColorAndShape("Spike", PBShape.ArrowUp_Hollow, SysColor.VolumeUp); TriggerAlert("Spike", @"Spike"); SetScanResult("Spike"); return; } DefinePaintbarParameter("BarsTotal", "# Bars Total", true, 2, 500, 1, 15); int BarsTotal = (int)GetPaintbarParameter("BarsTotal"); if (Max(BarsTotal,Close) == Close) && BarVolume[1]>15000 { SetColorAndShape("Breakout", PBShape.ArrowUp_Hollow, SysColor.VolumeUp); TriggerAlert("Breakout", @"Breakout"); SetScanResult("Breakout"); } }
  6. No idea how that happened! Everything working very well now. Thanks.
  7. AMC is at the top of the list and highlighted. The time of trigger is obscured by the Alert Log window but was given. There was also a separate pop-up alert window notification (with voice) confirming the alert had been triggered.
  8. Here is an example: AMC is triggered at 9:45:53 but not appearing in Alert Log. Also, it's not just the scan alerts, many of the built-in alerts (eg moving up % alert, etc) don't always appear in the Alert Log.
  9. Still an issue. Most of the portfolio scan triggers are not logged in Alert Log. The portfolio row is highlighted and a pop-up alert appears without a corresponding entry in Alert Log. For instance so far this morning I've had over 10 different stocks triggering the alert but I've only got 3 different stocks listed in the Alert Log.
  10. In my scan notification I have clear after None Seconds, restart after Immediate. Pop-up Alert and Highlight Row are both ticked. But both of these are separate from the Alert Log, aren't they? It does seem I am getting some (but not all) scan alert triggers that are showing up with a portfolio highlight and alert pop-up but not appearing in the Alert Log. I will check this again tomorrow.
  11. No. Some scan alerts are appearing (same scan/portfolio) so it's not a setting. Could it be due to how long the alert is triggered? An alert condition can quickly change from true to false. Perhaps the alert log needs the condition to be true for a minimum time before it's logged (whereas the pop-up alert notification will pop-up as soon as it's true and won't be removed)?
  12. I just noticed a portfolio scan alert appearing in Alert Log. So some are getting through..and some not.
  13. Earlier today my Alert Log was showing alerts for a portfolio scan but now these are no longer appearing. The portfolio scan alerts show up in the portfolio (highlighted row) as well as a pop-up alert notification. But why have they stopped appearing in the Alert Log. Surely if the alerts are getting triggered they should always appear in the Alert Log?
  14. Thanks. Alert notifications and Alert Log is working well to monitor the scan.
  15. Attached paintbar MTspike shows fewer matches (over entire time period - including RTH) if extended hours is set to Always. I did a crude version which shows more hits. Any symbol can be used, eg BBIG, DIDI, etc MTspike.PBExport ArgSpike.PBExport
  16. The code matches just about all hits during RTH (matching with other software). It doesn't pick up most of the pre/post market ones - perhaps there is some difference in input data during these times? Anyway, it is working well enough. One strange thing: setting Extended Hours to Always prevented any matches being shown (might be something in the code as I made another version which works ok on extended hours setting). The portfolio alert system doesn't seem to show the results for long enough. In order to see any matches I will need to keep my eyes on the portfolio all the time. The matches that appear in the Scan Result column are there for a very short time (seems to be much less than 1 minute). I would like an easy way to check to see what matches there have been - even if they were 5 minutes ago. The scan/watchlist on TOS provides this as it's possible to add code to provide a count back to the last trigger bar. The data can be sorted on this number to easily show the most recent matches.
  17. GTEC only shows Friday on the chart (10 days / 2 mins). If I type in other tickers on same chart I can see data for many days.
  18. Scan and paintbar are working. A few questions: 1) scan/paintbar doesn't seem to work in pre/post market. How do I fix this? 2) A scan trigger will fill in 2 columns in my portfolio: Scan Result column (with word "On") and ScanDT column with the time of the trigger. Both of these will disappear after a short time (probably to the next new bar?). Is there any way to find out the list of symbols that have been triggered? It would be useful if the Scan Result column could show a number indicating the number of bars elapsed since the last trigger. Or perhaps the ScanDT column could keep the trigger time shown permanently.
  19. At moment you have to click on the symbol name in the portfolio to bring up that symbol on a linked chart. It would be quite a bit more convenient if clicking anywhere on the portfolio line could activate the linked chart.
  20. How do I use this as a paintbar - my attempt below doesn't work. What am I doing wrong? var LogVal = Math.Log(Close[1]/Close[2]); CloseLog.Add(LogVal); var SDevClose = CloseLog.GetStDev() * Math.Sqrt(Period/(Period-1D)); var m = SDevClose * Close[1]; var pricespike = (Close-Close[1])/m > 3; LogVal = BarVolume[2]==0?0:Math.Log(BarVolume[1]/BarVolume[2]); VolLog.Add(LogVal); var SDevVol = VolLog.GetStDev() * Math.Sqrt(Period/(Period-1D)); var n = SDevVol * BarVolume[1]; var volumespike = n==0?false:((BarVolume-BarVolume[1])/n > 3); var scan = pricespike && volumespike && BarVolume[1]>15000; SetColorAndShape("spike", PBShape.ArrowUp_Hollow, SysColor.VolumeUp); TriggerAlert("spike"); SetScanResult(scan);
  21. Wow...thanks a lot for this. Will try it out asap!
  22. Hi, I have a simple script that I used elsewhere to find a spike in price/volume. I would like to use it here but need some assistance. There are two parts, first one for a spike in price, second part for a spike in volume. Both are identical in form. The final condition for the scan is to have true results for both the price and volume condition. The pseudocode is below. The ''def'' keyword is used to define a variable or a constant, and also a condition. c is the current price of the stock (not a 'closed' price - despite the name). c[1] is the closing value (price) of the last completed bar. c[2] is the closing value of the bar before c[1]. Same thing with volume v, v[1], v[2], v[3] etc. The stdev(closeLog, 11) calculates the standard deviation of 11 values of closeLog. So (if my understanding is correct) first value will be log(c[1] / c[2]), second value will be log(c[2] / c[3]), etc up to the final 11th value, which will be log(c[11] / c[12]). Any suggestions or help converting to a format suitable for the advanced scanner would be appreciated. ---------------------------------------------------------- def length = 11; def c = close; def closeLog = log(c[1] / c[2]); def SDevClose = stdev(closeLog, length) * sqrt(length / (length-1)); def m = SDevClose * c[1]; def pricespike = (c - c[1]) / m > 3; def v = volume; def volumeLog = log(v[1] / v[2]); def SDevVol = stdev(volumeLog, length) * sqrt(length / (length-1)); def n = SDevVol * v[1]; def volumespike = (v - v[1]) / n > 3; scan = pricespike and volumespike; -------------------------------------------------------------
×
×
  • Create New...