I figured it out, you just have to use the return function. I have done the majority of my coding in VBA so you can see the variable as you step through the code
Have updated my code (for long positions only) to have an indicator that will show you you exit levels
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
//trailing stop function
//variables
mytradedprice=open
myclose=close
trailingstart=10//trailing will start
trailingstep=5//trailing step to move the "trailing stop"
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