Hi, fellow traders.
I’ve made a breakout system on a minute bar chart.
However, I want at max one trade on each hour frame.
For example, when an order is executed at 16:05, and the stoploss/ gain is hit before 17:00, I don’t want the system to start a new trade ( if the variables are met) before 17:00.
On the other hand, if the stoploss is not hit before 17:00 it should stay open.
The reason I try to work with a minute bar system is because that way the ystem reacts faster on a break-out ( with hour bars, you have to wait until the next hour).
Is there a way to do this?
kind regards,
JSParticipant
Senior
Hi,
Do you really want a maximum of 1 transaction per hour or do you want a maximum of 1 transaction every hour…
- Transaction closed at 16:15 then the next transaction can take place after 17:15… (no transaction for a whole hour)
- Transaction closed at 16:15 then the next transaction can take place after 17:00… (part of an hour no transaction)
Hi JS,
Thanks for the reply. I’m looking for a solution like your second option ( number 2).
Kind regards,
JSParticipant
Senior
Hi,
Try this one…
DefParam CumulateOrders=false
If NOT OnMarket and (BarIndex - TradeIndex(1)) < CurrentMinute then
TradeOn = 0
Else
TradeOn=1
EndIf
If MyConditions and TradeOn=1 then
Buy 1 contract at Market
...
Thank you JS,
I’ll try the code this evening at home and I’ll keep you posted!
regards,
Unfortunate, it didn’t work out.
The system kept generating orders during the same hour ( after the stoploss or stopgain was hit).
regards,
JSParticipant
Senior
Hi,
That’s strange because it works for me…
Maybe the cause is in another part of your code…?
No, I just forgot to adjust the part in line nr. 9.
It works great!
thanks
JSParticipant
Senior
After I thanked you (thanks) your “topic count” went from 1 to zero…
And your replies went from 3 to 1…
I better not thank you… 😉