Tradecounter does not work
Forums › ProRealTime English forum › ProOrder support › Tradecounter does not work
- This topic has 8 replies, 4 voices, and was last updated 3 years ago by
phoentzs.
-
-
09/01/2021 at 12:39 PM #176587
Sorry for the maybe stupid question. I’ve been working on this little breakout system for hours now. But I can’t get the Tradecounter to work. It doesn’t open any trades. What am I doing wrong? It should be able to open a trade once a day in each direction. So a maximum of once long and once short. Somehow I can’t get the counter loop through. Could anyone help me, please?
12345678910111213141516171819202122232425262728293031323334353637DEFPARAM CumulateOrders = FALSEDefparam Preloadbars = 1000defparam Flatafter = 210000ONCE TradeLong = 0ONCE TradeShort = 0IF IntraDayBarIndex = 0 THENTradeLong = 0TradeShort = 0ENDIFdis = 20hl = disgl = hl + 10//start = hlIF Time = 080000 THENEntryLong = close + dis * pipsizeEntryShort = close - dis * pipsizeENDIFIF Time >= 080000 AND Time <= 140000 THENIF EntryLong and not tradelong THENBUY 1 Contract AT EntryLong STOPSET STOP pLOSS hlSET TARGET pPROFIT glTradelong = 1ENDIFIF EntryShort and not tradeshort THENSELLSHORT 1 Contract AT EntryShort STOPSET STOP pLOSS hlSET TARGET pPROFIT gltradeshort = 1ENDIFendif09/01/2021 at 12:50 PM #17658809/01/2021 at 12:53 PM #17658909/01/2021 at 1:12 PM #176592Ha, I have it. the counter has to get out of the loop for stop orders and only count when the order is triggered and you are in the market. Thank you anyway.
My Insert Code button doesn’t exist.
if longonmarket then
Tradelong = 1
endif
if shortonmarket then
tradeshort = 1
endif1 user thanked author for this post.
09/01/2021 at 1:14 PM #17659309/02/2021 at 5:35 AM #17663009/02/2021 at 6:30 AM #17663109/06/2021 at 1:54 PM #176870Hi,
If you fix the counter issue and it still isn’t putting trades or it is erratic when it goes live, on you may want to try using “Buy at Market” rather than using a “buy stop” at the market level
09/06/2021 at 5:19 PM #176893 -
AuthorPosts
Find exclusive trading pro-tools on