Hi,
Just following on from my last post & would be grateful for any input possible.
I am using a 1 min chart which if a condition is met a Long / Short is action.
What I would like to do is it to wait 2 min (for example) and then carry out a second trade (accumulate).
(What I am trying to control here is a signal that holds for 5 minutes and as a consequence – 5 separate trades are initiated all
more or less at the same price)
Or
If the price moves 10 further points carry out another trade.
Thanks you in advance for any help you can suggest.
Regards
BH
Hi, for your first needs, you can use TRADEINDEX which gives you the quantity of elapsed bars since when the last trade opened.
For your next request, I’ll answer in the other topic 🙂
Would you not have to use ‘Barindex – TradeIndex’ in order to get quantity of elapsed bars since when the last trade opened? Or am I confused again?
I know you know this Nicolas as it will be ‘2nd nature to you’ and a bit like asking you … how do you breathe! ha
Apologies for my British humour
GraHal
Hi,
I think I’ve managed to sort it – I’ve arrived at the following code
IF c1 AND NOT LongOnMarket THEN
BUY 2 PERPOINT AT MARKET
ENDIF
//let's add another order taken with a condition of 10 bars elapsed since the first one
IF BARINDEX-TRADEINDEX(1)>10 AND C1 THEN
BUY 2 PERPOINT AT MARKET
ENDIF
This stops the accumulation of orders one minute to the next – but actioned the second Long – which is what I wanted to try and achieve.
I’ll continue to check for variatons on this and let you know if I come up with any variants.
Regards
Hugh
Yes I think you do it right.
But you take new trade based on time only, not on price so your next buy order could be above or below the open price of the first one. Just for your information.
@GraHal : this is correct! 🙂
Hi the Hug
IF BARINDEX-TRADEINDEX(1)>10 means ... If the number of bars in the 'previous Trade' > 10.
Is this what you want?
Or do you want
IF BARINDEX-TRADEINDEX >10 means ... If the number of bars in the 'current trade' > 10?
Cheers
GraHal
Thanks GraHal,
You’re welcome to get in touch if you want to exchange some ideas. My email address is ukprtfan@yahoo.com
Hi Guys,
Can anyone advise on how to code buy order and at the same time to add several market orders to fill if price goes up?
Thank you.