MQL4 - automated forex trading   /  

Forum

ODL Securities

How do I call a variable from init() into my code?

Back to topics list To post a new topic, please log in or register

avatar
3
weetahdid 2008.07.24 23:01 

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?

article

Interview with Rich (Roman Zamozhniy)

We had an interview with the Winner of the Automated Trading Championship 2006 – Mr. Roman Zamozhniy, known under the nickname Rich. Regardless his winning in the last-year Championship, Roman completely redesigned his trading strategy. Roman is not afraid of the competition. He feels he fights against the market, and not against other Participants.


avatar
1455
phy 2008.07.25 01:52 

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.

Back to topics list  

To add comments, please log in or register