EA Indicator: Signal shift
2 replies
Threshold
9 years ago #112650
I want to shift the signal arrow to the previous candles. See below. This is a signal indicator, not EA.
Is there somewhere in this code I can shift the arrow?
double getDrawOffset(int signalIndex, int i) { if(signalIndex == 1) { if(Signal1Pos == "High") { return(High[i]+atrOffset + (sigCountOffsets(signalIndex, "High"))*(atrOffset*0.1)); } else { return(Low[i]-atrOffset - (sigCountOffsets(signalIndex, "Low"))*(atrOffset*0.1)); } } if(signalIndex == 2) { if(Signal2Pos == "High") { return(High[i]+atrOffset + (sigCountOffsets(signalIndex, "High"))*(atrOffset*0.1)); } else { return(Low[i]-atrOffset - (sigCountOffsets(signalIndex, "Low"))*(atrOffset*0.1)); } } return(false); }
Possibly add an extern shift.
Mark Fric
9 years ago #126545
Hello,
you should be able to achieve this by a small change in the code. Find a function drawSignal and add one line in the beginning:
void drawSignal(int signalIndex, int i, double value) {
i = i-1;
… rest of the code unchanged
Mark
StrategyQuant architect
Threshold
9 years ago #126561
Awesome, thanks man. Your software and EAs teaching me a lot about mql4
Viewing 2 replies - 1 through 2 (of 2 total)