/// <summary> /// Entry point. This function is called when new quote comes /// </summary> public override void OnQuote() { // traça linha lenta SetValue(0, TMA10_.GetValue()); _markers[0].SetParams(CurrentData.GetPrice(PriceType.High), CurrentData.GetPrice(PriceType.Low), CurrentData.GetPrice(PriceType.Close)); if ((CurrentData.GetPrice(PriceType.Low) > TMA10_.GetValue()) && (CurrentData.GetPrice(PriceType.High) > TMA10_.GetValue())) { SetMarker(0, 0, Color.Green); _markers[0].side = Side.Buy; } else if ((CurrentData.GetPrice(PriceType.Low) < TMA10_.GetValue()) && (CurrentData.GetPrice(PriceType.High) < TMA10_.GetValue())) { SetMarker(0, 0, Color.Red); _markers[0].side = Side.Sell; } else { SetMarker(0, 0, Color.Yellow); _markers[0].side = Side.None; // colorir candles } SetValue(0, TMA10_.GetValue()); // traça linha media if ((CurrentData.GetPrice(PriceType.Close) > TMA20_.GetValue()) && (CurrentData.GetPrice(PriceType.Open) > TMA20_.GetValue())) { SetMarker(1, 1, Color.Green); } else if ((CurrentData.GetPrice(PriceType.Close) < TMA20_.GetValue()) && (CurrentData.GetPrice(PriceType.Open) < TMA20_.GetValue())) { SetMarker(1, 1, Color.Red); } else { SetMarker(1, 1, Color.Yellow); } SetValue(1, TMA20_.GetValue()); // traça linha lenta if ((CurrentData.GetPrice(PriceType.Close) > TMA200_.GetValue()) && (CurrentData.GetPrice(PriceType.Open) > TMA200_.GetValue())) { SetMarker(2, 2, Color.Green); } else if ((CurrentData.GetPrice(PriceType.Close) < TMA200_.GetValue()) && (CurrentData.GetPrice(PriceType.Open) < TMA200_.GetValue())) { SetMarker(2, 2, Color.Red); } else { SetMarker(2, 2, Color.Yellow); } SetValue(2, TMA200_.GetValue()); }
public override void NextBar() { // colocar as cores do grafico padrão igual ao fundo, assim o gráfico não é mostrado CurrentChart.BodyBottomColor = CurrentChart.BackgroundBottomColor; CurrentChart.BodyUpColor = CurrentChart.BackgroundBottomColor; // mostra o novo candle com o padrão de cores tabajara _markers.Insert(0, new Marker(CurrentData.Time(), CurrentData.GetPrice(PriceType.Open))); }