Hi there,
So, I am getting this message that comes up “Combined stops cannot be used with ProOrder” I’m a rookie so I’m guessing I’ve done something wrong.
// Definition of code parameters
DEFPARAM CumulateOrders = False // Cumulating positions deactivated
// The system will cancel all pending orders and close all positions at 0:00. No new ones will be allowed until after the "FLATBEFORE" time.
DEFPARAM FLATBEFORE = 075000
// Cancel all pending orders and close all positions at the "FLATAFTER" time
DEFPARAM FLATAFTER = 235500
// Prevents the system from creating new orders to enter the market or increase position size before the specified time
noEntryBeforeTime = 075000
timeEnterBefore = time >= noEntryBeforeTime
// Prevents the system from placing new orders to enter the market or increase position size after the specified time
noEntryAfterTime = 150000
timeEnterAfter = time < noEntryAfterTime
// Prevents the system from placing new orders on specified days of the week
daysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0
// Conditions to enter long positions
indicator1 = RSI[14](close)
c1 = (indicator1 CROSSES OVER 35)
IF c1 AND timeEnterBefore AND timeEnterAfter AND not daysForbiddenEntry THEN
BUY 13 PERPOINT AT MARKET
ENDIF
// Conditions to exit long positions
indicator2 = RSI[14](close)
c2 = (indicator2 CROSSES OVER 70)
IF c2 THEN
SELL AT MARKET
ENDIF
If not OnMarket then
// Do your Buy or Sell thing.
Endif
// or :
If not LongOnMarket then
// Do your Buy thing.
Endif
// or :
If ShortOnMarket then
// Do your Exit Short thing.
Endif
// Conditions to enter short positions
indicator3 = RSI[14](close)
c3 = (indicator3 CROSSES OVER 60)
IF c3 AND timeEnterBefore AND timeEnterAfter AND not daysForbiddenEntry THEN
SELLSHORT 13 PERPOINT AT MARKET
ENDIF
// Conditions to exit short positions
indicator4 = RSI[14](close)
c4 = (indicator4 CROSSES UNDER 30)
IF c4 THEN
EXITSHORT AT MARKET
ENDIF
If not OnMarket then
// Do your Buy or Sell thing.
Endif
// or :
If not LongOnMarket then
// Do your Buy thing.
Endif
// or :
If ShortOnMarket then
// Do your Exit Short thing.
Endif
// Stops and targets
SET STOP pLOSS 1 pTRAILING 60
SET TARGET pPROFIT 150
In line 99 you have used two different types of SL, which is not allowed despite what’s written in the manual, so you need to choose one of these two:
SET STOP pLOSS x
SET STOP pTRAILING y