mycode
mycode
conversionLine = donchian(Trigger)
baseLine = donchian(Length)
leadLine1 = avg(conversionLine, baseLine)
plot(almatrend,transp=15)
// stratergy from Robert N. 030615
// previous day close and high low , todays open excellent for intraday trading
// Condition 1 for Sell Alert: Candle 1 closes above EMA and low of the candle is >
EMA
sell_candle1_condition = (close[1] > emaValue[1]) and (low[1] > emaValue[1])
// Condition 2 for Sell Alert: Next candle (Candle 2) is red, its low touches EMA,
and its close is below the open of Candle 1
sell_candle2_condition = (close < open) and (low <= emaValue) and (close < close[1]
or(close<open[1]))
// Sell Alert condition: Candle 1 meets the first condition and Candle 2 meets the
second condition
sell_alert_condition = sell_candle1_condition and sell_candle2_condition
// Condition 1 for Buy Alert: Candle 1 closes below EMA and high of the candle is <
EMA
buy_candle1_condition = (close[1] < emaValue[1]) and (high[1] < emaValue[1])
// Condition 2 for Buy Alert: Next candle (Candle 2) is green, its high touches
EMA, and its close is above the open of Candle 1
buy_candle2_condition = (close > open) and (high >= emaValue) and (close > close[1]
or (close>open[1]))
// Buy Alert condition: Candle 1 meets the first condition and Candle 2 meets the
second condition
buy_alert_condition = buy_candle1_condition and buy_candle2_condition