![](http://content.invisioncic.com/r244106/set_resources_8/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
Mike Medved
-
Posts
1,559 -
Joined
-
Last visited
-
Days Won
126
Content Type
Profiles
Forums
Blogs
Gallery
Downloads
Events
Posts posted by Mike Medved
-
-
No - to find all those you either type SymbolData. <-- note the period - and look at the autocomplete. Or look in the simple scan editor's combo box.
-
SymbolData.Volume
-
Binance (and most other crypto exchanges) does not send that data. IN fact, I think only GDAX bothers to send the current bid/ask. For others, you have to subscribe to the order book and figure it out yourself, which we don't want to do for portfolios, since it would be incredibly wasteful.
-
Yes. "Max" is a function. "max" is a var. Sorry I am a bit too technical sometimes (in c# capitalization matters)
-
Please go to the Help in Dashboard and do Check Updates. Then restart MT.
-
As for your last one - I really cannot advise on the fine points of the scanning conditions/techniques
I can only make sure that you can put in whatever conditions you want. -
Ok there is a bug in the code about the scanner. Change the code to have
if ((Close == SymbolData.Low && CurrentState.IsNewLow) || Close<CurrentState.PrevLow)
and it will be shown as a scan.
-
Am checking on this
-
Since all you're doing is finding a new low, there are no variables to the script. Variables are there to use indicators. No indicators are used.
-
Hope it is profitable
Happy New Years to you and yours.
-
In the Scanning tab there is a button to edit parameters - they are at bottom.
As long as the portfolio updates with RT quotes, the scanner runs on every update in it and lights up the results. That's the whole point
-
If you want specifically NEW low (and not just at the low), you can't do it in basic.
/// <summary> /// Is called at start of paintbar calculation, should be used to initialize anything needed for the paintbar /// </summary> private void PaintbarInitialize() { } /// <summary> /// Holds paintbar state - fill with variables needed to be preserved for next paintbar calc /// </summary> private struct PaintbarState { public Boolean IsNewLow; public Double PrevLow; } /// <summary> /// Holds current PB state - use to calc PB, changes to it carry over to next PB calc /// </summary> private PaintbarState CurrentState; /// <summary> /// Holds saved PB state - internal /// </summary> private PaintbarState SavedState; /// <summary> /// Is called at start of paintbar calculation, should be used to clear the paintbar state /// </summary> private void PaintbarClearState() { CurrentState.IsNewLow = false; CurrentState.PrevLow = 0; } /// <summary> /// Saves paintbar state (called internally). /// </summary> private void PaintbarSaveState() { SavedState = CurrentState; } /// <summary> /// Restores paintbar state (called internally). /// </summary> private void PaintbarRestoreState() { CurrentState = SavedState; } public void MainCalculation() { if ((Close == SymbolData.Low AND CurrentState.IsNewLow) OR Close<CurrentState.PrevLow) { SetScanResult("New Low"); CurrentState.IsNewLow = true; CurrentState.PrevLow = Close; } else CurrentState.IsNewLow = false; }
-
FIFOQueue SavedPrevCloses; FIFOQueue PrevCloses; /// <summary> /// Is called at start of paintbar calculation, should be used to initialize anything needed for the paintbar /// </summary> private void PaintbarInitialize() { } /// <summary> /// Holds paintbar state - fill with variables needed to be preserved for next paintbar calc /// </summary> private struct PaintbarState { } /// <summary> /// Holds current PB state - use to calc PB, changes to it carry over to next PB calc /// </summary> private PaintbarState CurrentState; /// <summary> /// Holds saved PB state - internal /// </summary> private PaintbarState SavedState; Double PercentDrop = 0; /// <summary> /// Is called at start of paintbar calculation, should be used to clear the paintbar state /// </summary> private void PaintbarClearState() { DefinePaintbarParameter("Period", "Period", true, 1, 1000, 1, 10); DefinePaintbarParameter("Percent", "Drop %", false, 0.001, 100, 0.1, 0.1); var N = Convert.ToInt32(GetPaintbarParameter("Period")); PercentDrop = Convert.ToInt32(GetPaintbarParameter("Percent")); CurrentState = new PaintbarState(); SavedPrevCloses = new FIFOQueue(N); PrevCloses = new FIFOQueue(N); } /// <summary> /// Saves paintbar state (called internally). /// </summary> private void PaintbarSaveState() { SavedState = CurrentState; PrevCloses.CopyTo(SavedPrevCloses); } /// <summary> /// Restores paintbar state (called internally). /// </summary> private void PaintbarRestoreState() { CurrentState = SavedState; SavedPrevCloses.CopyTo(PrevCloses); } public void MainCalculation() { // calculate the EMA of the EMA PrevCloses.Add(Close); Double high, low; PrevCloses.GetHighLow(out high, out low); if (Close < high*(1-PercentDrop/100)) { SetColor(Color.Lime); // if used as a paintbar SetScanResult("Dropped!"); // if used as a scan } }
-
1. if you want to look for new high, you would have to check the State-stored previous high to current SymbolData.High, then save the current High to the State-stored previous high.
2. SymbolData.Volume is the cumulative volume for the current session
-
LOL. Advanced mode is really for people who know (somewhat) how to code and a little of C# syntax.
Ok I will make one and post it in a bit.
-
You would have to use advanced mode of that. Create a FIFOQueue of the Y (as in Y minutes) size as a state variable and add the Close to it. Then you can get the high and low from the FIFOQueue and compare it to the current value.
Help for FIFOQueue: https://www.medvedtrader.com/trader/WebHelp/circbuffer_class.htm
the example at the end of this page should help too: https://www.medvedtrader.com/trader/WebHelp/state_keeping.htm
-
The scan and paintbar code can be shared. You can run your scan as a paintbar (putting it SetColor instead of the TriggerAlert) and it will show up on the chart.
For daily high, use SymbolData.High, for low SymbolData.Low - all these can be found in the simple editor's combo box lists.
-
public void MainCalculation()
{// this parameter will show in the scan/paintbar parameter editor and can be changed by the user
DefinePaintbarParameter("PCT", "Percentage", false, 0, 200, 1, 0.2);
// get the percent paramer
var Per = GetPaintbarParameter("PCT");
if (Close > Low[1] * (1 + Per/100))
{
SetColorAndShape("Breakeout", PBShape.ArrowNE, 0xFF00C50C);
TriggerAlert("Breakeout");
SetScanResult("Breakeout");
return;
}
}As for your other suggestion - you can either sort on the scan column or filter the portfolio so that only the rows that have some scan result show.
-
That was the goal
We innovate.
-
That looks good (depending on how you defined those vars but I presume those are defaulted).
Run it not as a scan, but as a paintbar (obviously replacing SetScanResult with SetColor) and check on a chart if it catches those conditions.
-
That's a good question MTG - it is actually a pretty complicated formula, I tinkered with it until I found something that works reasonably well.
it is Max(emamax, Min(average * 6, max * 1.02)
where
emamax = the max value of visible volume EMA, if you have it with the volume
average = the average value of visible volume bar, and
max = the maximum value of visible volume bar
-
in c# you can add a variable either as
Double X = Low[1] * 1.02;
or
var X = Low[1] * 1.02;
Can you describe, in words, what you're trying to accomplish?
-
For the second one - can you explain what you mean by
MACD hashes are red going to green or closed red going to open red
-
Here's the 1st one
Create Scanners
in Scan and Paintbar Help/Discussion
Posted
1. Make a Simple paintbar
2. Make 3 rules in it.
First one is SymbolData.Volume<=100000 and the action would have "And Stop"
Second is MFI<20 - again, "And Stop"
Third one MACD Hist crosses up 0 - put the SetScanResult in there.