Jump to content
Medved Trader Forums

jasper

Members
  • Posts

    5
  • Joined

  • Last visited

Everything posted by jasper

  1. So i'm much better coding in nodeJS, and am wondering if i can have medved perform a localhost server request or database request or some other location i deposit market data? for example if the scan performs a get request to localhost:8080?TSQ (a nodeJS server) and have returned some JSON or XML data that can be used within the scanner/paintbar? I was also curious if an intraday scan could perform a request to medved's built-in API to retrieve daily data within an intraday scan?
  2. So i have it working, and like you say, First and Last are the only ones giving me a result. First and Last give me the same result (Last = First). when i try to result a FIFOQ.Sum, it also just results in the same value as FIFOQ.First, and when i result FIFOQ.Count it shows 1 leading me to think the Q is clearing with each new day and only holding on the the current days value?
  3. Mike, thanks for your help. I really like your if statement to find the first bar of the day. When I use the FIFOQueue I don't get any results on the scanner or in my charts. Here is what I just tried: FIFOQueue Qvwap; FIFOQueue SQvwap; private void PaintbarInitialize(){} private struct PaintbarState{public DateTime SessionStart;} private PaintbarState CurrentState; private PaintbarState SavedState; private void PaintbarClearState() { CurrentState = new PaintbarState(); FIFOQueue Qvwap = new FIFOQueue(100); FIFOQueue SQvwap = new FIFOQueue(100); } private void PaintbarSaveState() { SavedState = CurrentState; Qvwap.CopyTo(SQvwap); } private void PaintbarRestoreState() { CurrentState = SavedState; SQvwap.CopyTo(Qvwap); } public void MainCalculation(){ var session = GetTradingSessionInfo(Timestamp); if (CurrentState.SessionStart != session.SessionStart){ CurrentState.SessionStart = session.SessionStart; Qvwap.Add(vwap[1]); } SetColorAndShape("Line", PBShape.Rectangle, SysColor.MainIndicator2); SetYValue(Qvwap.Last); SetScanResult(Qvwap[4]+", "+Qvwap.First); }
  4. I am trying to code an indicator that paints the end of day vwap from the previous day as a line for the current day (on a 5 minute chart). I have managed to plot this on my chart, but cannot seem to carry forward the historical values for these lines. for example, it would be nice to have a FIFO Q(20) with the last 20 horizontal line values. Attached you should find an image of a chart with this paintbar. private void PaintbarInitialize(){} private struct PaintbarState{public double today;} 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(){ var session = GetTradingSessionInfo(Timestamp); if (Timestamp == session.SessionStart){ if (vwap[1] > .01 ) {CurrentState.today = vwap[1];} else if (vwap[2] > .01 ) {CurrentState.today = vwap[2];} else if (vwap[3] > .01 ) {CurrentState.today = vwap[3];} else if (vwap[4] > .01 ) {CurrentState.today = vwap[4];} else if (vwap[5] > .01 ) {CurrentState.today = vwap[5];} else if (vwap[6] > .01 ) {CurrentState.today = vwap[6];} } SetColorAndShape("Line", PBShape.Rectangle, SysColor.MainIndicator2); SetYValue(CurrentState.today); SetScanResult(CurrentState.today); }
  5. just curious, any development on this?
×
×
  • Create New...