Please forgive the newbie question but I am new to coding. I am trying to write a script where when certain conditions are met a pending buy or sell order is placed when price hits the value of tema. The pseudocode would be:

If (condition) then

Buy (MoneyManagement computed) lots at TEMA( 74 )[1]; (and the reverse for a sell order).


I know you can call a function inside an enterLong() command, but I can't figure out how to do this.