How do I input the trading strategy so that it accurately logs "enter long/exit long" and also "enter short / exit short" positions separately?
// LONG
strategy.order("LONG", strategy.long, when = window() and buy) // buy long when "within window of time" AND crossover
strategy.order("SHORT", strategy.short, when = window() and sell) // sell long when "within window of time" AND crossunder
// SHORT
strategy.order("SHORT", strategy.short, when = window() and sell and shouldTrade) // buy long when "within window of time" AND crossover
strategy.order("LONG", strategy.long, when = window() and buy and shouldTrade)
But as you see in the image, it only shows "ENTER LONG / EXIT LONG" and it completely ignores the profits earned from "Enter SHORT / EXIT SHORT" which it doesnt even show.
entry short
– TetraDev Jun 11 '18 at 20:08shouldTrade
condition, two orders in these same direction can be submitted. I'm not sure how TradingView Pine deals with that, and if your pyramiding settings allow for that. – Jos Jun 12 '18 at 7:21