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”
Indicator Example
1
2
3
4
5
6
// Indicators for the system
MA=Average[30](close)// Simple moving average
cond1=close>MAANDclose>Supertrend[3,10]// Conditions for long positions
cond2=close<MAANDclose<Supertrend[3,10]// Conditions for short positions
RETURNcond1AS"cond1",cond2AS"cond2"
System:
System
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
CALL"Example"
X=1// Number of contracts
IF(cond1)THEN
BUYXCONTRACTSATMARKET
ENDIF
IFLONGONMARKETAND(cond2)THEN
SELLATMARKET
ENDIF
// Short positions
IF(cond2)THEN
SELLSHORTXCONTRACTSATMARKET
ENDIF
IFSHORTONMARKETANDcond1THEN
EXITSHORTATMARKET
ENDIF
// Stops and targets : Enter your protection stops and profit targets here
SET STOPpTrailing5// Backtest StopLoss if contracts increases
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. 🙂
To help us continually offer you the best experience on ProRealCode, we use cookies. By clicking on "Continue" you are agreeing to our use of them. You can also check our "privacy policy" page for more information.Continue