Hmm I'm trying to make a code to open a position in the opposite/same direction the last H1 candle closed, with preset TP and SL. I just can't get it right.
double dDiff = iClose(NULL,PERIOD_H1,1) - iOpen(NULL,PERIOD_H1,1);
I got this as candle close, but I don't know how to set it's direction, as in if it closed up go long, if it closed short go short.
Help with finishing this will be much appreciated.
double dDiff = iClose(NULL,PERIOD_H1,1) - iOpen(NULL,PERIOD_H1,1);
I got this as candle close, but I don't know how to set it's direction, as in if it closed up go long, if it closed short go short.
Help with finishing this will be much appreciated.