IIF (Buy, ...) then Shellexecute but its triggering every bar

Hi Folks,

I must be doing something wrong but this is triggering the shell execute on every bar

IIf(Buy == True, ShellExecute("C:\\Users\\Name\\.spyder2-py3\\temp.py", "", "" ),0);

Moderator comment: Read the forum rules and use code tags! I have better things to do than adding missing [code]...[/code]

Can you please advise?

Thanks.

2 posts were merged into an existing topic: IIf function versus if statement