Dalewoods Posted April 22, 2022 Report Share Posted April 22, 2022 (edited) Let's say I want to run a scan on a historical Daily Chart triggering an Alert if today's Volume is greater than the average volume. Something like this for explanation purpose: Now, let's assume I have a second portfolio which is exactly the same as the first one. For every symbol where the condition from the historical scan is true, I want an Alert if the Symbol trades in the bottom 20% of its day range. (or some other stuff that needs to be done in an intraday scan) I am not looking for some kind of workaround to put this into one scan, but I use this as a plain example to ask for a concrete illustration of how the Inter-Paintbar Communication works. My question is, where and how to implement both the SetInterVar and the GetInterVar functions into the code. I added as //comments into the snippets what I have tried so far, but apparently this is not how to do it. A huge thanks in advance for anyone who devotes his time and skill to helping this medved newbie Edited April 22, 2022 by Dalewoods Quote Link to comment Share on other sites More sharing options...
Jerry Medved Posted April 22, 2022 Report Share Posted April 22, 2022 In the Historical scan, when you call the command to trigger the alert, also set the Intervar. For example if (true) // use your condition instead of just true { SetScanResult(0, true); SetInterVar("histHighVol", 1); } Then, in your intraday scan, you use GetInterVar for histHighVol and then if it is 1 (or just greater than zero) do whatever else. For example: public void MainCalculation() { if (GetInterVar("histHighVol") > 0) { var IsBottom20Range = true; // add your own actual condition instead of true if (IsBottom20Range) SetScanResult(0, true); } } Quote Link to comment Share on other sites More sharing options...
Jerry Medved Posted April 22, 2022 Report Share Posted April 22, 2022 NOTE: if the Historical scan causes the histHighVol InterVar to be changed, the intraday scan will not see the change till next time it is triggered (next quote). So you may need 2 quotes to actually trigger the 2nd scan - one that gets the historical scan to update, and then the next quote would get intraday quote to update, since you cannot assume which order the scans will be processed in . Quote Link to comment Share on other sites More sharing options...
Dalewoods Posted April 22, 2022 Author Report Share Posted April 22, 2022 (edited) I am not sure if I get this right. As the list of collected historical scan results is extending, the intraday scan can only further process these symbols if.. what happens? Do you mean that the intraday scan will only consider the new symbols (in its check for fulfillment) as of the timestamp of the very next tick since its appeareance in the historical scan? Edited April 22, 2022 by Dalewoods Quote Link to comment Share on other sites More sharing options...
Jerry Medved Posted April 22, 2022 Report Share Posted April 22, 2022 not timestamps. just occurrence of quotes. so: * quote comes in. Intraday scan checks - var is 0. Hist scan runs - sets var to 1 * next quote comes in. Intraday scan checks - var is 1 so it does stuff..... as you see, 2 quotes needed for the intraday scan to see the change. Quote Link to comment Share on other sites More sharing options...
Dalewoods Posted April 22, 2022 Author Report Share Posted April 22, 2022 Alright, got it.. Thank you so much! Quote Link to comment Share on other sites More sharing options...
RSS Posted April 29, 2022 Report Share Posted April 29, 2022 Hi, Very new to Medved and C# in general. Trying to set up something similar using SetInterVar(). I have a portfolio with S&P 500 stocks that I run a historical scan through to narrow down to under the 100 symbol limit for a live intraday scan. I then have a second portfolio with the same 500 stocks and wanted to run the intraday scan on them, but only if they met the historical scan conditions. The Historical Scan is set up with an If and Else statement giving an output that labels stocks as bullish or bearish on the Daily. Where I put the SetScanResult, I have also included SetInterVar() like Jerry has above. But it's not working. Not sure if I understood correctly but here are the steps I'm doing 1. Open portfolio #1, run historical scan, and stop scan 2. Open Portfolio #2 and run intraday scan, however, it is pulling stocks not meeting the historical scan criteria. I can't seem to understand this, any help would be appreciated. Thank you! Quote Link to comment Share on other sites More sharing options...
Jerry Medved Posted April 29, 2022 Report Share Posted April 29, 2022 Please send us the settings & log so we can check. Please do the following: Go to FILE / HELP => Send Log/Settings to support menu (from Dashboard or Portfolio) And add this Post’s URL in the comment. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.