hi,
one short question … I have 3 existing automatic trading strategies …what do I have to put in , if I only like to have one execution per strategie and per day,
thx for the support
There are a couple of bits of code that may help, depending on your code. Can you share it and I can suggest what might work.
attached 3 strategies on dax mini
1.
DEFPARAM CumulateOrders = False //
defparam flatbefore=080000
defparam flatafter=173000
MyRSI = RSI[14](close)
MyBollingerDown = BollingerDown [25](close)
IF MyRSI <24 AND close < MyBollingerDown then
buy 10 CONTRACT AT MARKET
ENDIF
// Stops und Targets
SET STOP pLOSS 12
set target pprofit 4
2.
DEFPARAM CumulateOrders = False
defparam flatbefore=090000
defparam flatafter=173000
// Bedingungen zum Einstieg in Long-Positionen
indicator1 = MACDline[12,26,9](close)
c1 = (indicator1 CROSSES under -7)
IF c1 THEN
BUY 5 CONTRACT AT MARKET
ENDIF
// Stops und Targets
set target pprofit 10
3.
DEFPARAM CumulateOrders = False //
defparam flatbefore=080000
defparam flatafter=173000
// Bedingungen zum Einstieg in Long-Positionen
indicator1 = RSI[14](close)
c1 = (indicator1 < 20)
IF c1 THEN
BUY 6 CONTRACT AT MARKET
ENDIF
// Stops und Targets
SET STOP pLOSS 20
set target pprofit 5
these are 3 single strategies where i only like to have max 3 execution the day
thx for your support
Could you try this template. I got this from Pro Real Time them selves a few months ago. Sorry I have no time to test until tomorrow. If this doesn’t work there is another idea. You didn’t mention what time frame(s) you are testing on.
P.S >> For clarity of messages on ProRealCode’s forums, please use the “insert code PRT” button to separate the text of the code part! Thank you! <<
Once nbTrades = 0
Once tradesPerDay = 1
If Day<>Day[1] then
nbTrades = 0
Else
If (Not OnMarket[1] and OnMarket) xor (ShortOnMarket[1] and LongOnMarket) xor (LongOnMarket[1] and ShortOnMarket) then
nbTrades = nbTrades + 1
Endif
Endif
If nbTrades < tradesPerDay then
// Paste your code here and test, keep any DEFPARAM at the top still
Endif
thx first of all for your replay and support
sorry that doesnt seem to work
No difference at all? What time frame are you using?
Try this, taken from some code by @sylvess
DEFPARAM CumulateOrders = False
defparam flatbefore=080000
defparam flatafter=173000
Once LastTradeDate = 0
MyRSI = RSI[14](close)
MyBollingerDown = BollingerDown [25](close)
IF MyRSI <24 AND close < MyBollingerDown And LastTradeDate<>OpenDate then
buy 10 CONTRACT AT MARKET
LastTradeDate = OpenDate
ENDIF
// Stops und Targets
SET STOP pLOSS 12
set target pprofit 4
hi sylvess,
you made my day …looks good
thx for your support
one more question to my aim having only one trade per strategie
attached the programm, what do i have to add , if i like to have only one trade per day :
DEFPARAM CumulateOrders = False //
defparam flatbefore=080000
defparam flatafter=173000
// Bedingungen zum Einstieg in Long-Positionen
indicator1 = RSI[14](close)
c1 = (indicator1 < 20)
IF c1 THEN
BUY 6 CONTRACT AT MARKET
ENDIF
// Stops und Targets
SET STOP pLOSS 20
set target pprofit 5
Hi, the same modifications as suggested should work with all three, just copy the logic. Try for your self and let us know.
hi cosmic,
thats not working …programm dont accept” Defparam flatbefore=083000 and Defparam flatafter=173000″
…sorry i did a mistake , …now it seems to be working …thx for your support
No worries, glad it is working.
hi cosmic , your code is not correct …i have put in like you said …but programm shows more than one executions mid october … i believe on the 18oct
Once nbTrades = 0
Once tradesPerDay = 1
If Day<>Day[1] then
nbTrades = 0
Else
If (Not OnMarket[1] and OnMarket) xor (ShortOnMarket[1] and LongOnMarket) xor (LongOnMarket[1] and ShortOnMarket) then
nbTrades = nbTrades + 1
Endif
Endif
If nbTrades < tradesPerDay then
DEFPARAM CumulateOrders = False //
defparam flatbefore=080000
defparam flatafter=173000
// Bedingungen zum Einstieg in Long-Positionen
indicator1 = RSI[14](close)
c1 = (indicator1 < 20)
IF c1 THEN
BUY 6 CONTRACT AT MARKET
ENDIF
// Stops und Targets
SET STOP pLOSS 20
set target pprofit 5
endif
I think this logic / example will serve you better.
DEFPARAM CumulateOrders = False
defparam flatbefore=080000
defparam flatafter=173000
Once LastTradeDate = 0
MyRSI = RSI[14](close)
MyBollingerDown = BollingerDown [25](close)
IF MyRSI <24 AND close < MyBollingerDown And LastTradeDate<>OpenDate then
buy 10 CONTRACT AT MARKET
LastTradeDate = OpenDate
ENDIF
// Stops und Targets
SET STOP pLOSS 12
set target pprofit 4
hi , thats on bollinger ….but how does it have to look like on the above mentioned rsi stuff
DEFPARAM CumulateOrders = False
defparam flatbefore=080000
defparam flatafter=173000
indicator1 = RSI[14](close)
c1 = (indicator1 < 20)
IF c1 THEN
BUY 6 CONTRACT AT MARKET
ENDIF
SET STOP pLOSS 20
set target pprofit 5
indicator1 = RSI[14](close)
c1 = (indicator1 < 20)
IF c1 THEN
BUY 6 CONTRACT AT MARKET
ENDIF
SET STOP pLOSS 20
set target pprofit 5