uk
Experience: Intermediate
Platform: ninja
Broker: amp
Trading: ES
Posts: 179 since Aug 2009
|
Hi.
Recently downloaded TOS to play around with.
I see that it actually comes with LBR 3/10 indicator as standard.
I have this indicator on my NT7 platform, but with the NT7 version, it draws these 'momentum dots' that I sometimes use when playing a breakout trade in the early part of the day
I'm wondering it someone could create a Thinkorswim version with the dots for me.
I'm assuming it would just take a few seconds as the indicator is already in thinkorswim and I just want the dots added.
I know NOTHING about programming, but I've attaced the NT7 code, and i've emboldened the part which I assume is where the dots come from:
/// <summary>
/// LBR:3/10 Oscillator
/// </summary>
[Description("LBR:3/10 Oscillator")]
[Gui.Design.DisplayName("LBR310")]
public class LBR310 : Indicator
{
#region Variables
// Wizard generated variables
private int fast = 3; // Default setting for Fast
private int slow = 10; // Default setting for Slow
private int longLine = 16; // Default setting for LongLine
private int MoMoPeriod = 40; //Look for momentum highs
private int BarHiLo = 20; //Look for price highs
private int BarLookback = 3; //Period in which the BarHigh needs to have occurred
private DataSeries diff;
private DataSeries avg;
// User defined variables (add any user defined variables below)
#endregion
/// <summary>
/// This method is used to configure the indicator and is called once before any bar data is loaded.
/// </summary>
protected override void Initialize()
{
Add(new Plot(Color.DarkOrange, PlotStyle.Line, "OscLine"));
Add(new Plot(Color.CornflowerBlue, PlotStyle.Bar, "OscBarUP"));
Add(new Plot(Color.Maroon, PlotStyle.Bar, "OscBarDn"));
Add(new Plot(Color.Lime, PlotStyle.Line, "HPLineUp"));
Add(new Plot(Color.DarkViolet, PlotStyle.Line, "HPLineDn"));
Add(new Line(Color.LightGray, 0, "ZeroLine"));
diff = new DataSeries(this);
avg = new DataSeries(this);
CalculateOnBarClose = false;
DrawOnPricePanel = false;
Overlay = false;
PriceTypeSupported = false;
}
/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()
{
// Use this method for calculating your indicator values. Assign a value to each
// plot below by replacing 'Close[0]' with your own formula.
double FastAvg = SMA(Close, fast)[0];
double SlowAvg = SMA(Close, slow)[0];
double Difference = (FastAvg - SlowAvg) / TickSize;
diff.Set((FastAvg - SlowAvg) / TickSize);
double Average = SMA(diff, longLine)[0];
avg.Set(SMA(diff, longLine)[0]);
OscLinePlot.Set(Difference);
Print(High + " " + CurrentBar);
if (Rising(diff))
OscBarUpPlot.Set(Difference);
else
OscBarDnPlot.Set(Difference);
if ((HighestBar(diff, MoMoPeriod) == 0 && HighestBar(High, BarHiLo) <= BarLookback) || (LowestBar(diff, MoMoPeriod) == 0 && LowestBar(Low, BarHiLo) <= BarLookback))
// DrawDot("Up Dot" + CurrentBar, 0, Difference, Color.Lime);
DrawDot("Up Dot" + CurrentBar, true, 0, Difference, Color.Lime);
if (Rising(avg))
{
HPLinePlotUp.Set(1, avg[1]);
HPLinePlotUp.Set(Average);
}
else if (Falling(avg))
{
HPLinePlotDn.Set(1, avg[1]);
HPLinePlotDn.Set(Average);
----
thanks for any help
|