LongTriggered is a function in ProBuilder language that is used to determine if a long position has been opened on a specific candlestick. This function is particularly useful for identifying if an order has been executed and whether its associated stop loss or take profit has been triggered within the same candlestick. This is especially relevant in scenarios involving pending orders, also known as Working Orders (WO).
LongTriggered[N]
Where N is an optional parameter that specifies the candlestick index relative to the current candlestick. If N is not provided, it defaults to 0, indicating the current candlestick.
if LongTriggered then
buycount=buycount+1
endif
This example checks if a long position was opened on the previous candlestick (N=1). If true, the buycount variable is increased by 1.
Using LongTriggered effectively can help in managing trades more precisely by providing immediate feedback on order execution and its consequences within a trading strategy.