I am writing a automate flow, similar to below..
I select the symbol from webhook. say natagmini and tradingview_lot as 8
case 1
if I have any open position in symbol natagmini current expiry.. ( say 2 bullish , could be created manually)
then want to sell 2 lots from current expiry and 6 lots from next expiry.
case 2
and if I do not have any open position… in symbol natagmini current expiry ( say 0)
then i want to sell 8 lots from next expiry.
Note:- I can always have other open positions like Cruide oils or other
My current flow works fine in case 1,
but case 2 execution fails, with error.. because positionOfsymbol check simply fails if there is no position.
and we do not have any guard/ conditon check possible to check if a open position exisits for particular symbol in my portfolio …
Suggestion/Improvement
Solution 1:- ( solves this particular problem , could be a WA or qucik solution without huge design change)
`positionOfsymbol ` if no position exists should still return a position with quanity 0, price 0 etc…
so a guard /check can be added to see if I actually have the position.
Solution 2 ( better overall design but complex, but handles it for any other cases across actions) :- with Yes and No output for If condition, (or for any action,) add a new path Error..
if any error occurs, new error path if configured will execute.
like say :- order placement, if success then do something, target price do something, sl do something, order placement fails( new error path) , do something else
if failed to get position of symbols, thats a error for the expression/if condition.. on error, do some other flow..
Please fix this its very important .