Ticket number is assigned by Dealer. Your idea does not sound plausible.
StrategyTester assigns sequential Ticket numbers, you will not necessarily see that on demo or live trading.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I want to find a ticket number once in my Init sequence and increment it through the rest of my code when I place orders.
Basically I place an order. If there are other orders, I close the order. And decrement that ticket number until the symbol equals "EURUSD". Other wise I leave the order open and it is my last order.
That ticket no is LastEUR_Order. Can I end my init() with the following?:
return(LastEUR_Order);
If I want to print the string, it says that the variable needs to be initialised and otherwise is equal to 0.
Should I maybe write it to a .CSV file?