Playing around with indicator and calling too system but i doesn’t work. I know that I can build in the system but I am building a bigger indicator and want too make it work this way.
Whats wrong..?
Indicator named “Example”
// Indicators for the system
MA = Average[30](close) // Simple moving average
cond1 = close > MA AND close > Supertrend[3,10] // Conditions for long positions
cond2 = close < MA AND close < Supertrend[3,10] // Conditions for short positions
RETURN cond1 AS "cond1", cond2 AS "cond2"
System:
CALL "Example"
X = 1 // Number of contracts
IF (cond1) THEN
BUY X CONTRACTS AT MARKET
ENDIF
IF LONGONMARKET AND (cond2) THEN
SELL AT MARKET
ENDIF
// Short positions
IF (cond2) THEN
SELLSHORT X CONTRACTS AT MARKET
ENDIF
IF SHORTONMARKET AND cond1 THEN
EXITSHORT AT MARKET
ENDIF
// Stops and targets : Enter your protection stops and profit targets here
SET STOP pTrailing 5 // Backtest StopLoss if contracts increases
I solved it myself… noobie mistake
umebon – Glad to hear that you solved your own problem but please follow the forum rules with any future topics and give your topic a meaningful title. I have changed your topic title. 🙂