public bool SellRule() { // Verkaufe, wenn RelDiff > 2. Depot depot = this.RuleEngineInfo.Depot; WorkDate today = RuleEngineInfo.Today; if (depot.Contains("dbx1da")) { if (dax_rel_diff[today] > 0) { if (depot[0].TrailingGap > 2) { depot[0].TrailingGap -= 0.2; } } if (depot[0].StopLoss > depot[0].Price) { Sell("dbx1da"); sell_events[today] = dax_rel_diff[today]; sell_events_dax[today] = dax_close[today]; return(true); } } return(false); }
public bool SellRule() { // Verkaufe, wenn RelDiff > 2. Depot depot = this.RuleEngineInfo.Depot; WorkDate today = RuleEngineInfo.Today; if (depot.Contains("846900")) { if (dax_rel_diff[today] > 0) { depot[0].TrailingGap *= 0.8; } if (//dax_rel_diff[today] > 5 || dax_trend[today] != dax_trend[today - 1] || depot[0].StopLoss > depot[0].Price ) { Sell("846900"); sell_events[today] = dax_rel_diff[today]; sell_events_dax[today] = dax_close[today]; return(true); } } return(false); }
public bool BuyRule() { Depot depot = this.RuleEngineInfo.Depot; WorkDate today = RuleEngineInfo.Today; if (dax_trend[today] >= 0) { if (depot.Contains("846900") == false) { if (dax_rel_diff[today] < -5 && dax_close[today - 1] < dax_close[today]) { Buy("846900"); buy_events[today] = dax_rel_diff[today]; buy_events_dax[today] = dax_close[today]; return(true); } } } return(false); }