protected void OnTradeByChartTrader(object sender, IndicatorEventArgs e) { this.Update(); IndicatorSignal isig = e.IndSignal; Print(String.Format("{0}:OnTradeByChartTrader {1} Bip={2}, CurrentBar[0]={3}, DrawingTool.GetCurrentBar={4}, \r\n Bars.GetTime(CurrentBars[0])={5}, Time[BarsInProgress][0]={6}, Time[0][0]={7}", CurrentBars[BarsInProgress], isig.SignalName, BarsInProgress, CurrentBars[0], DrawingTool.GetCurrentBar(this), Bars.GetTime(CurrentBars[0]), Times[BarsInProgress][0], Times[0][0])); if (isig.SignalAction != null) { if (isig.SignalAction.SignalActionType == SignalActionType.BarToLeft) { StopEnBarIndex = StopEnBarIndex < 1? CurrentBars[0] : StopEnBarIndex - 1; } else if (isig.SignalAction.SignalActionType == SignalActionType.BarToRight) { StopEnBarIndex = StopEnBarIndex > CurrentBars[0]? 1 : StopEnBarIndex + 1; } } UpdateStopEnBar(); UpdateHiLoPrice(); }
void OnTradeByChartTrader(object sender, IndicatorEventArgs e) { this.Update(); IndicatorSignal isig = e.IndSignal; Print(String.Format("{0}:OnTradeByChartTrader triggerred {1} Bip={2}, CurrentBar[0]={3}, DrawingTool.GetCurrentBar={4}, Time={5}, Time[0][0]={6}", CurrentBars[BarsInProgress], isig.SignalName, BarsInProgress, CurrentBars[0], DrawingTool.GetCurrentBar(this), Times[BarsInProgress][0], Times[0][0])); //Draw.ArrowUp(this, "tag1", true, 0, Lows[0][0] - TickSize, Brushes.Red); Draw.Diamond(this, "tag1", true, 0, Lows[0][0] - TickSize, Brushes.Red); }