I have the following code written for placing cumulative orders.
however it works fine(excellent) but placing only non cumulative orders
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
// Main code : 1_imp_hr_forex_stop2_cum
//-------------------------------------------------------------------------
// Definition of code parameters
DEFPARAM CumulateOrders = true
DEFPARAM FlatBefore = 080000
DEFPARAM FlatAfter = 180000
Ctime = time > 080000 and time < 180000
x= 5
IF ctime and not onmarket THEN
BUY 2 PERPOINT AT close [ 1 ] + x stop
sellshort 2 PERPOINT AT close [ 1 ] - x stop
ENDIF
x1= 1
x2= 5
z= 1
if longONMARKET then
BUY z perpoint at tradeprice (1 )+ x2 stop
endif
if shortONMARKET then
sellshort z perpoint AT tradeprice (1 )- x2 stop
endif
set target profit 10
set stop loss 2
// Stops and targets
if shortonmarket then
buy at close [ 1 ] + x1 stop
endif
if longonmarket then
sell at close [ 1 ] - x1 stop
endif
Edited by moderator to make PRT code format appear, please use the <> button when inserting PRT code in your messages
Message moved from French forum to English forum, and from “ProBuilder” forum (indicators) to “ProOrder” forum (strategies)