Tradeindex – Define please
Forums › ProRealTime English forum › ProOrder support › Tradeindex – Define please
- This topic has 7 replies, 4 voices, and was last updated 1 year ago by robertogozzi.
-
-
05/18/2016 at 11:11 PM #7307
Which of the following is correct please?
- Tradeindex is the number of bars since the last trade, a number which increases until the next trade. Example: First Trade at ‘Barindex 250’ and so BarIndex 250 is the same bar as Tradeindex 1 and barindex 251 is same bar as Tradeindex 252 etc. Next Trade at barindex 300 and so barindex 300 is same bar as tradeindex 1 and barindex 301 is same bar as Tradeindex 2. The trade at barindex 250 is then Tradeindex(1) 1 and barindex 251 is same bar as Tradeindex(2)2
- Tradindex is the bar index number of the last trade, i.e a single number that doesnt change until the next trade. Example: First trade at ‘barindex 250’ which is tradeindex 250 and then after another 50 bars at barindex 300 the next trade occured and so tradeindex is now 300 and tradeindex(1) is 250.
I reckon I can now see the answer … its the 2nd paragraph above??
I have read the PRT manual re Tradeindex and this site but still not 100% sure.
Thanks
GraHal
05/19/2016 at 7:21 AM #7315Hi GraHal, you are right with the 2nd paragraph.
The tradeindex is the exact same number of the barindex when the trade occurred. This number will never change for this trade of course.
I realize there is a mistake in the website documentation about this instruction, I’ll fix it today. Sorry for inconvenience 🙂
When you are not sure of what values something do return, just use the GRAPH instruction, that’s what I have done for your question.
05/19/2016 at 9:28 AM #732509/05/2023 at 5:11 PM #220370Bonjour à tous !J’essaie de programmer un code qui achète lorsqu’un signal est donné (ex RSI <15) et qui ne vendra QUE si la cloture d’une bougie suivante est supérieure au prix d’achat.Mon problème est que si la bougie d’achat cloture plus haut que le prix d’achat, le trade est cloturé…J’essaie de placer cette ligne :If LONGONMARKET and barindex > tradeindex and close > positionprice then …Mais cela ne fonctionne pas…Je ne vois pas ce qui cloche…Merci de votre aide !MichelHello everyone ! I am trying to program a code that buys when a signal is given (eg RSI <15) and which will ONLY sell if the close of a following candle is higher than the purchase price. My problem is that if the buy candle closes higher than the buy price, the trade is closed… I try to place this line:
If LONGONMARKET and barindex > tradeindex and close > positionprice then…
But This doesn’t work… I don’t see what’s wrong… Thank you for your help! Michael
09/05/2023 at 5:49 PM #22037309/05/2023 at 7:06 PM #220379Hi,
If you do not want the position in the same bar to open and close, use:
BarIndex-TradeIndex>1
If LongOnMarket and (BarIndex-TradeIndex)>1 and Close > TradePrice then
Sell at Market
EndIf
1 user thanked author for this post.
09/06/2023 at 6:33 PM #22045609/07/2023 at 10:05 AM #220484Only post in the language of the forum that you are posting in. For example English only in the English speaking forums and French only in the French speaking forums.
Thank you 🙂
-
AuthorPosts
Find exclusive trading pro-tools on