#5mins Chart Strategy #Pairs: Any #Indicator #EMA(50) Indicator ema50 = EMA(applyTo: close, period: 50) #EMA(100) Indicator ema100 = EMA(applyTo: close, period: 100) #MACD and MACD signal. macd = MACD(applyTo: close, fastPeriod: 12, slowPeriod: 26) macdSignal = MACDSignal(applyTo: close, signalPeriod: 9, fastPeriod: 12, slowPeriod: 26) #Pips calculation, 10pips = 0.0010 in (USD/USD) pip10 = (10 * 0.01)/open pip5 = (5 * 0.01)/open #Rule longEntryRule1 = open > (ema50 + pip10) longEntryRule2 = open > ema100 longEntryRule3 = 0 series longEntryRuleMacd: once: 0 rest: CrossesUpwards(value: macd, crosses: macdSignal) #MACD crosses to positive within the last five bars, otherwise wait for the next longEntryRule3 = longEntryRuleMacd or longEntryRuleMacd[1] or longEntryRuleMacd[2] or longEntryRuleMacd[3] or longEntryRuleMacd[4] #Final Long Entry Rule FinalLongEntryRule = longEntryRule1 and longEntryRule2 and longEntryRule3 #Setting initial Stop period = 5 series stopLoss: once: open rest: open for distance from 1 to (period - 1) if low[distance] < stopLoss update stopLoss: low[distance] #Setting initial Stop period = 5 series StopLoss: once: open rest: open for distance from 1 to (period - 1) if low[distance] < StopLoss update StopLoss: low[distance]