// 売買 // hogehoge()=> で関数化しているけど、挙動は変数とかわらない enterLong() => not tradeDirection[1] and tradeDirection exitLong() => tradeDirection[1] and not tradeDirection strategy.entry(id = "Long", long = true, when = enterLong()) strategy.close(id = "Long", when = exitLong()) enterShort() => tradeDirection[1] and not tradeDirection exitShort() => not tradeDirection[1] and tradeDirection strategy.entry(id = "Short", long = false, when = enterShort()) strategy.close(id = "Short", when = exitShort())