Hello
I’m sorry if this seems obvious but I have tried many ways that seemed logical but don’t work – for me!
Can anyone help please?
When a signal is received the size and colour of the first bar is noted … then if the bar is green and CLOSE of any of the following bars is higher a BUY is activated or if the first bar is red and the CLOSE of any of the following bars is lower a SELLSHORT is activated.
Each bar to the next signal is checked against the first bar of the run and if none meet the criteria the cycle starts over the next time the signal is triggered – and a new ‘first bar’ is established.
I have tried setting an upper or lower variable against the value of the first bar and testing with greater/equal or lower/equal or crosses over/crosses under but I must be missing something ???
Thanks
There you go:
ONCE LongEntry = 0
ONCE ShortEntry = 0
Green = close > open
Red = close < Open
MySignal = ...........
IF MySignal AND Not OnMarket THEN
IF Green THEN
LongEntry = close
ShortEntry = 0
ELSIF Red THEN
LongEntry = 0
ShortEntry = close
ENDIF
ENDIF
IF OnMarket THEN
LongEntry = 0
ShortEntry = 0
ENDIF
IF LongEntry AND (close > LongEntry) THEN
BUY 1 CONTRACT AT MARKET
LongEntry = 0
ShortEntry = 0
ELSIF ShortEntry AND (close < ShortEntry) THEN
SELLSHORT 1 CONTRACT AT MARKET
LongEntry = 0
ShortEntry = 0
ENDIF
SET STOP pLOSS 150
SET TARGET pPROFIT 300
in line 5 you will need to define what MySignal is.