ramaParticipant
Senior
I have the following code written for placing cumulative orders.
however it works fine(excellent) but placing only non cumulative orders
// 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)
hello rama,
Could you add forex pair and time frame because I did some backtests without any trade.
Regarding lines 31 didn’t you want to use “exishort” fonction?