I am working on my first EA, and there are some things I'm not clear on. I'm reading the tutorial by Coder's Guru and I've also searched the MetaEditor's on-line help. I would like more info on the following.
1)What is Point for? This is apparently "the point value of the current bar (usually 0.0001)". Wouldn't the point value be the price? It's used in OrderSend: Ask+TakeProfit*Point, Ask-StopLoss*Point. Why do you multiply by Point here? Couldn't you set TakeProfit to 0.0020 and then in OrderSend you would write Ask+TakeProfit to specify the Take Profit price?
2)What is Slippage in OrderSend() function? I know what slippage is - the difference between the price when you tried to open or close an order and the price you were filled at. But what are you telling the OrderSend function when you specify a slippage amount?
3)What is difference between Symbol() and OrderSymbol()? I know OrderSymbol() is used after using OrderSelect and Symbol() is used in OrderSend(). Is that the extent of the difference? Is symbol() used anywhere else?
4)init() and deinit(). Init() is where you can initialize global variables or you can just initialize them when you declare them. Correct?
What is deinit() for? Is it a necessary part of every EA? Can I delete my deinit()?
Thanks.
1)What is Point for? This is apparently "the point value of the current bar (usually 0.0001)". Wouldn't the point value be the price? It's used in OrderSend: Ask+TakeProfit*Point, Ask-StopLoss*Point. Why do you multiply by Point here? Couldn't you set TakeProfit to 0.0020 and then in OrderSend you would write Ask+TakeProfit to specify the Take Profit price?
2)What is Slippage in OrderSend() function? I know what slippage is - the difference between the price when you tried to open or close an order and the price you were filled at. But what are you telling the OrderSend function when you specify a slippage amount?
3)What is difference between Symbol() and OrderSymbol()? I know OrderSymbol() is used after using OrderSelect and Symbol() is used in OrderSend(). Is that the extent of the difference? Is symbol() used anywhere else?
4)init() and deinit(). Init() is where you can initialize global variables or you can just initialize them when you declare them. Correct?
What is deinit() for? Is it a necessary part of every EA? Can I delete my deinit()?
Thanks.