Hi
Can anyone help me to make a trading system close all trades at 210000 on a Friday. I can use the defparam command to close at a set time each day but I don’t want a trade left open over the weekend I’m happy for trades to remain open overnight during the week?
dymjohn
Hi John.
Try this
IF CurrentDayOfWeek = 5 and time >=210000 then
SELL AT MARKET
Exitshort At market
Endif
Cheers Kasper
Hi Casper,
Thanks Casper, I thought the following might work but opens and closes all trades on Friday for a loss of the spread on test so not right.
indicator9 = dayofWeek =5
indicator10 = 210000
c7 = (indicator9 and indicator10)
IF c2 and c6 OR c7 THEN
SELL AT MARKET
ENDIF
Hello
>> 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! <<
Be careful with use of combinations of “and” and “or”, you might want to use parenthesis to make sure the logic you really want is applied, for example : c2 and (c6 or c7) is not the same as (c2 and c6) or c7