I am abit new to this software and i need helpwriting a trailing stop loss code.
I want it to do as the standard in trailing stop loss in pro order.
“Creates a trailing stop which takes as a reference the price level that created the highest profit since the position was opened” And i want it to be in $
How do i right that in code?
I have tried searching everywhere but never found a code that does exacly that.
This is the one I use, written by Nicolas. It assumes a fixed stop loss to start with, so you have to add SET STOP PLOSS x after the line of entry code.
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
32
33
34
35
36
37
38
39
//trailing stop function
trailingstart=10//trailing will start @trailinstart points profit
trailingstep=5//trailing step to move the "stoploss"
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.