Hi together, I use the target profit often but this time it doesn’t work and i can’t understand why.. Perhaps somebody can check if this code seems to be okay?
period = 15
LMA=2*weightedaverage[period](close)-average[period](close)
once support=low
once resistance=high
smoothLMA=weightedaverage[period](LMA)
IF LMA crosses over smoothLMA THEN
support=lowest[period](low)
ENDIF
IF LMA crosses under smoothLMA THEN
resistance=highest[period](high)
ENDIF
support=min(low,support)
resistance=max(high,resistance)
IF NOT LongOnMarket AND CLOSE > resistance[15] THEN
BUY 1 CONTRACTS AT MARKET
ENDIF
IF NOT ShortOnMarket AND CLOSE < support[15] THEN
SELLSHORT 1 CONTRACTS AT MARKET
ENDIF
SET TARGET PROFIT 10
SET STOP LOSS 30
On which instrument and TF are you running it?
TARGET PROFIT 10 means that you want your profit to be set at your openprice + 10, while it should be at openprice + 0.0010 (10 pips).
The perfect solution would be to use PPROFIT and not PROFIT, because PPROFIT automatically convert the desired points with the point size of the current instrument.