so to add a second larger position if the current one is profitable I will use the code:
1
2
3
4
5
inProfit=positionPerf>0
ifinProfitthen
buyxcontractatmarket
endif
How can one distinguish that it will add to a specific position if I have multiple? lets say I have 2 long positions and 3 short positions, does one add a label to the trades ? I mean I would need one more for sell on market and how does the script decide which one to use?
for instance…
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
// Buy condition
ifc1then
buy1contractatmarket
endif
// Add a second buy trade if first one is profitable
inProfit=positionPerf>0
ifinProfitthen
buy1contractatmarket
endif
// Sell condition
ifc1then
sellshort2contractatmarket
endif
// Add a second sell trade if first one is profitable
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