My Open Position on EA won't close automatically
Hey guys,
Im new here in coding, I tried to code together an EAm which simply uses the last 6 Candles, if thosse 6 are down-candles it opens up a long-position. That seems to work, but I cant get my EA to close that position on the next candle.
I would be glad, if theres anyone who can help me on that. I will provide the Code down below:
use the trade class to open positions.
It's simple, and less messy
#include <Trade/Trade.mqh> CTrade trade; Void OnTick() { //open BUY trade trade.Buy(0.01,NULL); //close trade trade.PositionClose(...); }
just a snippet. this code will not compile
Where do you check for a new candle?
Where do you check for an open order? Where do you try to close it?
Hey guys,
Im new here in coding, I tried to code together an EAm which simply uses the last 6 Candles, if thosse 6 are down-candles it opens up a long-position. That seems to work, but I cant get my EA to close that position on the next candle.
I would be glad, if theres anyone who can help me on that. I will provide the Code down below: