Hello!
I have a Problem with my programm.
The Idea is to go short on thursday on S&P if the close on wednesday is under the Supertrend (2,5 10).
Exit is at the end of the month. Entry at beginn of month. SL is if the course makes a new 20 day high.
The code works as estimated,
but i saw a detail that if the open on thursday is higher than the supertrend level from wednesday, there shouldn’t be a short trade.
On September 5.9.19 the open is higher than the supertrend level of wednesday 4.9.
In this case i don’t want to do the trade because it close is.
Can someone help me with my code?
defparam preloadbars=5000
defparam cumulateorders=false
size=(100000+strategyprofit)/(close)
// Festlegung Variablen
//Supertrendabfrage für Short
indicator7 = SuperTrend[2.5,10]
c7 = (close < indicator7)
c9 = dayofweek=4 //Wochentag Thursday
//Short Exit over 20 dayhigh
indicator10=DonchianChannelUp[20]
c10=close>indicator10
//Entry parameter
if not longonmarket and day>3 and day <24 and c7 and c9 then // short-parameter
sellshort size contracts roundedup at market
endif
if shortonmarket and day>24 or c10 then // parameter for short-close
exitshort at market
endif
Hi!
You could change the entry condition with a stop order.
sellshort size contracts roundedup at SuperTrend[2.5,10] stop
In this case, if the price on Thursday is higher than Supertrend you will not have a trade.
CLOSE, that day, was UNDER th eSuperTrend.
Yes Roberto you are right, but the entry start on 15:30. An on this time we stay over the super trend Level from day before. So I don’t want to entry this trade. I only want to do the trade if the open ist lower then supertrend the day before.
Can you help me?
Thanks. That is only a solution if the course is on open higher than the supertrend. All other cases i cant do the trade
I test
c8= open[1]<indicator7
and add this to the sell order, but it didn’T work. It still sell