void PlotChart()
        {
            if (Showtotalvolume)
            {
                TotalVolume.Set(totalvolume);
            }

            if (deltamode)
            {
                if (deltavolume > 0)
                {
                    UpVolume.Set(deltavolume);
                    DownVolume.Set(0);
                }
                else if (deltavolume < 0)
                {
                    UpVolume.Set(0);
                    DownVolume.Set((revneg) ? deltavolume : -deltavolume);
                }
                else
                {
                    UpVolume.Set(0);
                    DownVolume.Set(0);
                }
            }
            else
            {
                UpVolume.Set(upvolume);
                DownVolume.Set(downvolume);
            }
        }
示例#2
0
        void PlotChart()
        {
            if (CurrentBar < 1)
            {
                return;
            }

            if (deltavolume > 0)
            {
                UpVolume.Set(deltavolume);
                DownVolume.Set(0);

                if (textWarnings)
                {
                    if (Values[0][0] >= (multiplier * Values[0][1]) && Values[0][0] >= HighVolume && Values[0][1] > 0)
                    {
                        DrawText("Delta" + CurrentBar, true, Convert.ToString("v ") + Convert.ToString(Values[0][0]) + " ~↑ " + Close[0], 0, Low[0] - textOffset * TickSize, 0, textColor1,
                                 textFont, StringAlignment.Center, outlineColor1, areaColor1, zopacity1);
                    }

                    else
                    {
                        DrawText("Delta" + CurrentBar, true, Convert.ToString("NEUTRAL"), 0, Low[0] - textOffset * TickSize, 0, Color.Transparent,
                                 textFont, StringAlignment.Center, Color.Transparent, Color.Transparent, 0);
                    }
                }

                if (alertBox)
                {
                    if (Values[0][0] >= (multiplier * Values[0][1]) && Values[0][0] >= HighVolume && Values[0][1] > 0)
                    {
                        DrawTextFixed("AlertBox", (Instrument.MasterInstrument.Name) + " " + Convert.ToString(Values[0][1]) + " to" + Convert.ToString(Values[0][0]) + " @   " + Close[0], tpos, textColor3, textFont1, outlineColor3, areaColor3, zopacity3);
                    }

                    else
                    {
                        DrawTextFixed("AlertBox", "Alert", tpos, Color.Transparent, textFont1, Color.Transparent, Color.Transparent, 0);
                    }
                }

                if (SoundAlert)
                {
                    if (Values[0][0] >= (multiplier * Values[0][1]) && Values[0][0] >= HighVolume && Values[0][1] > 0)
                    {
                        try
                        {
                            Alert("Delta", NinjaTrader.Cbi.Priority.Medium, "DeltaX UP " + Bars.Period.Value + " Period" + " " + Convert.ToString(Values[0][1]) + " to " + Convert.ToString(Values[0][0]) + " @ " + Close[0], upFile, rearmTime, Color.Gold, Color.Navy);
                        }
                        catch {}
                    }
                }
            }

            else if (deltavolume < 0)
            {
                UpVolume.Set(0);
                DownVolume.Set(-deltavolume);

                if (textWarnings)
                {
                    if (Values[1][0] >= (multiplier * Values[1][1]) && Values[1][0] >= HighVolume && Values[1][1] > 0)
                    {
                        DrawText("Delta" + CurrentBar, true, Convert.ToString("v ") + Convert.ToString(Values[1][0]) + " ~↓ " + Close[0], 0, High[0] + textOffset * TickSize, 0, textColor2,
                                 textFont, StringAlignment.Center, outlineColor2, areaColor2, zopacity2);
                    }

                    else
                    {
                        DrawText("Delta" + CurrentBar, true, Convert.ToString("NEUTRAL"), 0, High[0] + textOffset * TickSize, 0, Color.Transparent,
                                 textFont, StringAlignment.Center, Color.Transparent, Color.Transparent, 0);
                    }
                }

                if (AlertBox)
                {
                    if (Values[1][0] >= (multiplier * Values[1][1]) && Values[1][0] >= HighVolume && Values[1][1] > 0)
                    {
                        DrawTextFixed("AlertBox", (Instrument.MasterInstrument.Name) + "   " + Convert.ToString(Values[1][0]) + " @   " + Close[0], tpos, textColor4, textFont1, outlineColor4, areaColor4, zopacity4);
                    }

                    else
                    {
                        DrawTextFixed("AlertBox", "Alert", tpos, Color.Transparent, textFont1, Color.Transparent, Color.Transparent, 0);
                    }
                }

                if (SoundAlert)
                {
                    if (Values[1][0] >= (multiplier * Values[1][1]) && Values[1][0] >= HighVolume && Values[1][1] > 0)
                    {
                        try
                        {
                            Alert("Delta", NinjaTrader.Cbi.Priority.Medium, "DeltaX DOWN " + Bars.Period.Value + " Period" + " " + Convert.ToString(Values[1][1]) + " to " + Convert.ToString(Values[1][0]) + " @ " + Close[0], downFile, rearmTime, Color.Plum, Color.Red);
                        }
                        catch {}
                    }
                }
            }
        }
示例#3
0
        void PlotChart()
        {
            if (deltavolume > 0)
            {
                UpVolume.Set(deltavolume);
                DownVolume.Set(0);

                if (textWarnings)
                {
                    if (Close[0] < Open[0])
                    {
                        DrawText("Delta" + CurrentBar, true, Convert.ToString(plotAlert), 0, High[0] + textOffset * TickSize, 0, textColor1,
                                 textFont, StringAlignment.Center, outlineColor1, areaColor1, Zopacity1);
                    }

                    else if (Close[0] >= Open[0])
                    {
                        DrawText("Delta" + CurrentBar, true, Convert.ToString("NEUTRAL"), 0, High[0] + textOffset * TickSize, 0, Color.Transparent,
                                 textFont, StringAlignment.Center, Color.Transparent, Color.Transparent, 0);
                    }
                }

                if (SoundAlert)
                {
                    if (Close[0] < Open[0])
                    {
                        try
                        {
                            Alert("Delta", NinjaTrader.Cbi.Priority.Medium, "Div Down " + Bars.Period.Value + " " + Values[0] + " " + CurrentBar, downFile, rearmTime, Color.Navy, Color.Magenta);
                        }
                        catch {}
                    }
                }
            }

            else if (deltavolume < 0)
            {
                UpVolume.Set(0);
                DownVolume.Set(-deltavolume);

                if (textWarnings)
                {
                    if (Close[0] > Open[0])
                    {
                        DrawText("Delta" + CurrentBar, true, Convert.ToString(plotAlert), 0, Low[0] - textOffset * TickSize, 0, textColor2,
                                 textFont, StringAlignment.Center, outlineColor2, areaColor2, Zopacity2);
                    }

                    else if (Close[0] <= Open[0])
                    {
                        DrawText("Delta" + CurrentBar, true, Convert.ToString("NEUTRAL"), 0, Low[0] - textOffset * TickSize, 0, Color.Transparent,
                                 textFont, StringAlignment.Center, Color.Transparent, Color.Transparent, 0);
                    }
                }

                if (SoundAlert)
                {
                    if (Close[0] > Open[0])
                    {
                        try
                        {
                            Alert("Delta", NinjaTrader.Cbi.Priority.Medium, "Div Up " + Bars.Period.Value + " " + Values[0] + " " + CurrentBar, upFile, rearmTime, Color.Navy, Color.Magenta);
                        }
                        catch {}
                    }
                }
            }
        }