Hi,
I create e very simple code in order to trade a the end of day if the max e min of the day exceeded the first candle of the last 10 minutes. I suppose to use a time frame o 5 minute in wall street cash (1530 cet time until 22:00 cet time). The system in back don’t trade and I don’t find the mistake. Can you hel me ? Thanks Emanuele
DEFPARAM CumulateOrders = false
DEFPARAM FlatAfter =220000
OraLimite = 215000
Orainizio = 215900
n=1
IF TIME=215000 THEN
CashHighMo = Highest[76](high)
CashLowMo = Lowest[76](low)
endif
if Time >= Orainizio and time <= Oralimite then
if not onmarket then
c1 = open > CashHighMo
c2= open < CashLowMo
IF c1 THEN
buy n contract at market
endif
IF c2 THEN
sellshort n contract at market
endif
endif
endif
SET STOP ptrailing 10
Hi,
I change the code after having see the video on you tube but I don’t solve the problem. Why ? Thanks
DEFPARAM CumulateOrders = false
DEFPARAM FlatAfter =220000
OraLimite = 215000
Orainizio = 215900
n=1
condition = time > 153000 and time < 215000
if condition then
Maxprice = max(Maxprice, high)
Minprice = min(Minprice, low)
endif
if Time >= Orainizio and time <= Oralimite then
if not onmarket then
c1 = close > Maxprice
c2= Close < Minprice
IF c1 THEN
buy n contract at market
endif
IF c2 THEN
sellshort n contract at market
endif
endif
endif
SET STOP ptrailing 10
I think it has to do with this piece of code. You don´t define maxprice and minprice if you have them on both side of the =.
if condition then
Maxprice = max(Maxprice, high)
Minprice = min(Minprice, low)
endif
Something like this?
DEFPARAM CumulateOrders = false
DEFPARAM FlatAfter =220000
OraLimite = 215000
Orainizio = 215900
n=1
if Time >= oralimite and time <= Orainizio then
c1= open < close-2
c2= open > close-2
if not onmarket then
IF c1 THEN
buy n contract at market
endif
IF c2 THEN
sellshort n contract at market
endif
endif
endif
SET STOP ptrailing 10
Hi,
Thanks but I want to have max e min of a certain range time of the day. In these manner that you have suggested to me I don’t have max e min. Thanks