Pivot= (DHigh(1) + DLow(1) + Dclose(1))/3
Res1 = 2*((DHigh(1) + DLow(1) + Dclose(1))/3) - DLow(1)
if not onmarket and close crosses over pivot then
buy 1 contract at market
sl=low
sell at sl stop
endif
if longonmarket then
sell at sl stop
endif
if not onmarket and close crosses over pivot then
buy 1 contract at market
res1= 2*((DHigh(1) + DLow(1) + Dclose(1))/3) - DLow(1)
sell at res1 stop
endif
if longonmarket then
sell at res1 stop
endif
Hello,
I would like buy if ‘close crosses over pivot’
and sell ‘if the close hit the resistance 1’
I use the ‘low[1]’ of entrybar as stoploss
Who can help me? How can i combine it?
Pivot= (DHigh(1) + DLow(1) + Dclose(1))/3
if not onmarket and close crosses over pivot then
buy 1 contract at market
res1 = 2*((DHigh(1) + DLow(1) + Dclose(1))/3) - DLow(1)
sell at res1 limit
entrylow = low
set stop ploss (close - entrylow)
endif
if longonmarket then
set stop ploss (positionprice - entrylow)
sell at res1 limit
endif
Not tested and written after a couple of glasses of wine!
Pivot= (DHigh(1) + DLow(1) + Dclose(1))/3
if not onmarket and close crosses over pivot then
buy 1 contract at market
res1 = 2*((DHigh(1) + DLow(1) + Dclose(1))/3) - DLow(1)
sell at res1 limit
sl=low
sell at sl stop
endif
if longonmarket then
sell at sl stop
sell at res1 limit
endif
Thanks for your reaction!
I change the code to this one^
It’s look like better.
I change the code to this one^ It’s look like better.
You say tomato and I say tomato.
I have moved this topic to the ProOrder Support forum as that is where it should be as it is a strategy coding question. Please try to post in the most relevant forum with future topics.
if not onmarket and close crosses over pp then
buy 1 contract at market
Res1 = 2 * PP - lastLow
sell at res1 limit
sl=low
sell at sl stop
endif
if longonmarket then
sell at sl stop
sell at res1 limit
endif
if not onmarket and close crosses over res1 then
buy 1 contract at market
Res2 = PP + hl
sell at res2 limit
sl=low
sell at sl stop
endif
if longonmarket then
sell at sl stop
sell at res2 limit
endif
Thank you!
I’m struggling now with the next thing.
I would like the strategy above combine with ‘buy at res1 and sell at res2’
What is the best way to combine it in one tradingstrategy?