Could this be translated into a lua strategy? (optional sl, limit and trailing would be nice, but are not a must).
- Code: Select all
Period=input('500')
longCondition = crossover(security(tickerid, Period, close),security(tickerid, Period, open))
if (longCondition)
strategy.entry("BUY", strategy.long)
shortCondition = crossunder(security(tickerid, Period, close),security(tickerid, Period, open))
if (shortCondition)
strategy.entry("SELL", strategy.short)
it's not very fancy but my attempts to bring this to lua are not really working very well (yet).
Period is in the pinescript a duration in minutes, but if I get ticks in lua it would also be fine with me (I'll then just convert it).
Any help with this would be highly appreciated.