hi
congratulations with this site.
i trade now automatic, crosssing the supertrend.
time frame 5 min
dax 30 mini
8.00 tot 12.00
if it possible , go in trade directly 8.00 before the first signal crossing supertrend.
with condition, for long: price > supertrend
for short; price < supertrend
thank you
luc
// Definitie van code parameters
DEFPARAM CumulateOrders = False // Opstapelen posities gedeactiveerd
DEFPARAM FLATBEFORE=080000
DEFPARAM FLATAFTER=120000
// Condities om long posities te openen
indicator1 = close
indicator2 = SuperTrend[2.8,3]
c1 = (indicator1 CROSSES OVER indicator2)
IF c1 THEN
BUY 1 LOT AT MARKET nextbaropen
ENDIF
// Condities om long posities te sluiten
indicator3 = close
indicator4 = SuperTrend[2.8,3]
c2 = (indicator3 CROSSES UNDER indicator4)
IF c2 THEN
SELL AT MARKET
ENDIF
// Condities om short posities te openen
indicator5 = close
indicator6 = SuperTrend[2.8,3]
c3 = (indicator5 CROSSES UNDER indicator6)
IF c3 THEN
SELLSHORT 1 lot at market nextbaropen
ENDIF
// Condities om short posities te sluiten
indicator7 = close
indicator8 = SuperTrend[2.8,3]
c4 = (indicator7 CROSSES OVER indicator8)
IF c4 THEN
EXITSHORT AT MARKET
ENDIF
// Stops en targets
SET STOP $LOSS 150
SET TARGET $PROFIT 700
Hello groen200,
We already talked on Skype, let me look at your code.
What you want is just to open a new long position if the price is above the Supertrend and sell it if the price is below it? right?
Do you want also to have multiple orders in the same day or just only one?
OK for to open a new long position if the price is above the supertrend and sell it if the price is below it
and then start my code crossing the supertrend, when we have (like to day) no crossing before 12.00 = no trade more
Here is the modified code groen200, hope it will be in accordance with your strategy as far as i understand it! 🙂 Supertrend groen200
// Definitie van code parameters
DEFPARAM CumulateOrders = False // Opstapelen posities gedeactiveerd
DEFPARAM FLATBEFORE=080000
DEFPARAM FLATAFTER=120000
//indi
st = SuperTrend[2.8,3]
//resetting variable
once lasttrade = 0
IF LONGONMARKET then
lasttrade = 1
elsif SHORTONMARKET then
lasttrade = -1
elsif hour<8 OR hour>12 then
lasttrade = 0
endif
// Condities om long posities te openen
IF close>st AND lasttrade<>1 THEN
EXITSHORT AT MARKET
BUY 1 LOT AT MARKET nextbaropen
ENDIF
// Condities om long posities te sluiten
IF close<st AND lasttrade<>-1 THEN
SELL AT MARKET
SELLSHORT 1 lot at market nextbaropen
ENDIF
// Stops en targets
SET STOP $LOSS 150
SET TARGET $PROFIT 700
GRAPH lasttrade AS "lasttrade"