HERE IT IS… pleas ejoin me here… let’s see if Nicolas will have time to help us…
As far as me neither know yet how to understand those results, we will wait for any help.
Really appreciated your time, thanks a lot!
By the way, second day running in real time with perfect execution, same prices as expected. 6 losses in a row, tomorrow will come the winner one! 😉
Best trading!
Hi there, there were a bug in IG demo server that causes trouble with pending orders. Strategies that were running may have to be relaunched to have it all good now.
Nice bell curve on your random distribution strategies results, may I have a look to the confidence interval?
Hi Nicolas, since when this IG demo problems occurs? Can we have more info? Will IG inform us?
Confidence intervall of montecarlo it is uploaded at the top od this page. do you mean that?
@Adolfo join me here http://www.prorealcode.com/topic/montecarlo/
I tryed it this morning since Nicolas said it’s fixed and seems to be working Ok. Stop and limit orders are placed at the right time and at the right price.
Thanks a lot 🙂
@Adolfo
Could you please confirm that the code and file in the library are the last version of your strategy please? This one is actually being tested and presented in a famous french trading forum named “Videobourse” : http://www.videobourse.fr/forum-forex/viewtopic.php?f=12&t=13369
So I want to be sure everything is ok. Thanks.
Is not a significant difference between results, but I feel better with this change. Same posted code without “SPREAD” variable, since is not “optimal” for real time trading.
A few losses in a row this week (as expected) 😉 There we go!
//-------------------------------------------------------------------------
// Main code : Binomio AutoTrading Bot DAX
//-------------------------------------------------------------------------
REM #########################################
REM ## Binomio AutoTrading Bot 2016 DAX 1m ##
REM #########################################
REM Not cumulate orders
defparam cumulateorders = false
REM No positions open before this time
defparam flatbefore = 080000
REM All positions will be closed after this time
defparam flatafter = 213000
REM MAX and MIN we want to operate
REM No orders will be set if range is greater than
maxrange = 150
REM No orders will be set if range is shorter than
minrange = 20
REM #########
profittrendvalue = 1.5 //1.5
profitrangevalue = profittrendvalue
//5 //1.7
rangepercent = 0.1 //0.1
REM ######################
REM ## MONEY MANAGEMENT ##
REM ######################
Capital = 3000
Risk = 0.5
REM RESET MAIN VARIABLES EACH NEW DAY
if Dayofweek = 5 then
trading = 0
else
If intradaybarindex = 0 then
trading = 1
bullish = 0
bearish = 0
inrange = 0
rangepips = 0
enter1 = 0
enter2 = 0
enter3 = 0
enter4 = 0
abovemax = 0
abovemin = 0
belowmax = 0
belowmin = 0
//profittrend = 0
profitrange = 0
endif
endif
REM CHECK CONTROL TIME
starttime = 075500
endtime = 075900
REM RANGE ESTABLISHMENT
IF time >= starttime and time <= endtime then
REM NIGHT MAX
maximo = dhigh(0)
REM NIGHT MIN
minimo = dlow(0)
REM RANGE IN PIPS BETWEEN NIGHT MAX AND MIN
rangepips = round(maximo-minimo)
REM PROFIT IN PIPS EX
profitrange = rangepips*profitrangevalue// i.e we could add here "*0.9" to reduce the profit objective
//profittrend = rangepips*profittrendvalue //1.5
REM DISTANCE FROM LINES TO SET ORDERS
margin = rangepips*rangepercent
REM SET MAX ORDER PLACES
abovemax = maximo+margin
belowmax = maximo-margin
REM SET MIN ORDER PLACES
abovemin = minimo+margin
belowmin = minimo-margin
REM SET NUMBER OF PIPS TO RISK EACH TRADE
StopLoss = round(margin*2)
if StopLoss<6 then
StopLoss = 6
endif
endif
REM Calculate contracts
equity = Capital + StrategyProfit
maxrisk = round(equity*(Risk/100))
PositionSize = abs(round((maxrisk/StopLoss)/PointValue)*pipsize)
REM SPREAD CHECK
//IF Time>=090000 and time<173000 then
//spread = 0 // Backtest spread is set to 1
//else
//spread = 1 // Backtest spread 1 + 1 = Real spread
//endif
REM CONDICION DEL MERCADO
inrange = Close<maximo-margin and close>minimo+margin
bullish = Close>(maximo+margin)
bearish = Close<(minimo-margin)
semibull = Close>maximo-margin and close<maximo+margin
semibear = close<minimo+margin and close>minimo-margin
REM START SETTING ORDERS
REM FIRST TRADES
if not onmarket and trading = 1 and rangepips<=maxrange and rangepips>=minrange then
REM RESET VARIABLES EACH TIME WE ARE OUT OF THE MARKET
if bearish then
if enter4=0 then
sellshort PositionSize contract at market//belowmin limit
endif
if enter1=0 then
buy PositionSize contract at abovemin stop
endif
endif
if bullish then
if enter3=0 then
buy PositionSize contract at market//abovemax limit
endif
if enter2=0 then
sellshort PositionSize contract at belowmax stop
endif
endif
if inrange then
if enter1=0 then
buy PositionSize contract at abovemin limit
endif
if enter2=0 then
sellshort PositionSize contract at belowmax limit
endif
if enter3=0 then
buy PositionSize contract at abovemax stop
endif
if enter4=0 then
sellshort PositionSize contract at belowmin stop
endif
endif
if semibull then
if enter3=0 then
buy PositionSize contract at abovemax stop
endif
if enter2=0 then
sellshort PositionSize contract at belowmax stop
endif
endif
if semibear then
if enter1=0 then
buy PositionSize contract at abovemin stop
endif
if enter4=0 then
sellshort PositionSize contract at belowmin stop
endif
endif
endif
buytrend = tradeprice(1)>maximo
buyrange = tradeprice(1)<maximo
selltrend = tradeprice(1)<minimo
sellrange = tradeprice(1)>minimo
REM SI ESTAMOS LARGOS
if longonmarket then
REM IF TRADE PRICE IS ABOVE MAX
if buytrend then
enter3 = 1
if enter2=0 then
sellshort PositionSize contract at belowmax stop
endif
endif
REM IF TRADE PRICE IS INTO DE RANGE
if buyrange then
enter1 = 1
if enter4=0 then
sellshort PositionSize contract at belowmin stop
endif
endif
endif
REM SI ESTAMOS CORTOS
if shortonmarket then
REM SI HEMOS VENDIDO POR DEBAJO DEL MINIMO
if selltrend then
enter4 = 1
if enter1=0 then
buy PositionSize contract at abovemin stop
endif
endif
REM SI HEMOS VENDIDO DENTRO DEL RANGO
if sellrange then
enter2 = 1
if enter3=0 then
buy PositionSize contract at abovemax stop
endif
endif
endif
set stop ploss stoploss
set target pprofit profitrange
Best trading ever 😉
Hi Adolfo,
Great you are sharing you knowledge here!
I copied you code into PRT and tried a back test in 1 minute resolution and 10000 units. But it doesn’t buy or sell anything when trying on DAX. Is it something more I need to configure to make it work? Appreciate your advice, thanks.
Hi
@Adolfo and david-1984
Why did this interesting and useful discussion come to an end so abruptly?
Did below happen? If yes, please add a link so we can ‘see the end of the story’ please?
If you send me your data I run it whit my system (very similar with nicolas system) and we can open a new thread where to disucuss how to read the montecarlo.
Many Thanks
GraHal
I’m back on this, but I get the results attached, not good! 🙂
Anybody any ideas why?
I’ve minus 1 hour from times UTC +2 (Spain) to UTC+1 (my Platform in UK).
V2 (2 or 3 posts above) attached also.
Thank You
GraHal
dans pro order, j ai ce message. je n arrive pas a le testé. même si je supprime. merci
AEParticipant
Senior
Hi all,
I´m checking this strategy and it works really good right now, even after three years since last update. Anybody is using this strategy in Real right now? Anyone make new changes?
I was doing some tests and I would like to check it with 200k bars with this configuration. Anyone can help me and tell us how it works with 200k bars?
//-------------------------------------------------------------------------
// Main code : Binomio AutoTrading Bot v.2 DAX
//-------------------------------------------------------------------------
REM ###############################################
REM ## Binomio AutoTrading Bot Julio 2019 DAX 1m ##
REM ##############################################
REM Not cumulate orders
defparam cumulateorders = false
REM No positions open before this time
defparam flatbefore = 080000
REM All positions will be closed after this time
defparam flatafter = 213000
REM MAX and MIN we want to operate
REM No orders will be set if range is greater than
maxrange = 150
REM No orders will be set if range is shorter than
minrange = 20
REM #########
profittrendvalue = 2//1.5
profitrangevalue = profittrendvalue
//5 //1.7
rangepercent = 0.1//0.1
REM ######################
REM ## MONEY MANAGEMENT ##
REM ######################
Capital = 3000
Risk = 0.5
REM RESET MAIN VARIABLES EACH NEW DAY
if Dayofweek = 5 then
trading = 0
else
If intradaybarindex = 0 then
trading = 1
bullish = 0
bearish = 0
inrange = 0
rangepips = 0
enter1 = 0
enter2 = 0
enter3 = 0
enter4 = 0
abovemax = 0
abovemin = 0
belowmax = 0
belowmin = 0
//profittrend = 0
profitrange = 0
endif
endif
REM CHECK CONTROL TIME
starttime = 075500
endtime = 075900
REM RANGE ESTABLISHMENT
IF time >= starttime and time <= endtime then
REM NIGHT MAX
maximo = dhigh(0)
REM NIGHT MIN
minimo = dlow(0)
REM RANGE IN PIPS BETWEEN NIGHT MAX AND MIN
rangepips = round(maximo-minimo)
REM PROFIT IN PIPS EX
profitrange = rangepips*profitrangevalue// i.e we could add here "*0.9" to reduce the profit objective
//profittrend = rangepips*profittrendvalue //1.5
REM DISTANCE FROM LINES TO SET ORDERS
margin = rangepips*rangepercent
REM SET MAX ORDER PLACES
abovemax = maximo+margin
belowmax = maximo-margin
REM SET MIN ORDER PLACES
abovemin = minimo+margin
belowmin = minimo-margin
REM SET NUMBER OF PIPS TO RISK EACH TRADE
StopLoss = round(margin*2)
if StopLoss<6 then
StopLoss = 6
endif
endif
REM Calculate contracts
equity = Capital + StrategyProfit
maxrisk = round(equity*(Risk/100))
PositionSize = abs(round((maxrisk/StopLoss)/PointValue)*pipsize)
REM SPREAD CHECK
IF Time>=090000 and time<173000 then
spread = 0 // Backtest spread is set to 1
else
spread = 1 // Backtest spread 1 + 1 = Real spread
endif
REM CONDICION DEL MERCADO
inrange = Close<maximo-margin and close>minimo+margin
bullish = Close>(maximo+margin)
bearish = Close<(minimo-margin)
semibull = Close>maximo-margin and close<maximo+margin
semibear = close<minimo+margin and close>minimo-margin
REM START SETTING ORDERS
REM FIRST TRADES
if not onmarket and trading = 1 and rangepips<=maxrange and rangepips>=minrange then
REM RESET VARIABLES EACH TIME WE ARE OUT OF THE MARKET
if bearish then
if enter4=0 then
sellshort PositionSize contract at market//belowmin limit
endif
if enter1=0 then
buy PositionSize contract at abovemin+spread stop
endif
endif
if bullish then
if enter3=0 then
buy PositionSize contract at market//abovemax limit
endif
if enter2=0 then
sellshort PositionSize contract at belowmax-spread stop
endif
endif
if inrange then
if enter1=0 then
buy PositionSize contract at abovemin limit
endif
if enter2=0 then
sellshort PositionSize contract at belowmax limit
endif
if enter3=0 then
buy PositionSize contract at abovemax+spread stop
endif
if enter4=0 then
sellshort PositionSize contract at belowmin-spread stop
endif
endif
if semibull then
if enter3=0 then
buy PositionSize contract at abovemax+spread stop
endif
if enter2=0 then
sellshort PositionSize contract at belowmax-spread stop
endif
endif
if semibear then
if enter1=0 then
buy PositionSize contract at abovemin+spread stop
endif
if enter4=0 then
sellshort PositionSize contract at belowmin-spread stop
endif
endif
endif
buytrend = tradeprice(1)>maximo
buyrange = tradeprice(1)<maximo
selltrend = tradeprice(1)<minimo
sellrange = tradeprice(1)>minimo
REM SI ESTAMOS LARGOS
if longonmarket then
REM IF TRADE PRICE IS ABOVE MAX
if buytrend then
enter3 = 1
if enter2=0 then
sellshort PositionSize contract at belowmax-spread stop
endif
endif
REM IF TRADE PRICE IS INTO DE RANGE
if buyrange then
enter1 = 1
if enter4=0 then
sellshort PositionSize contract at belowmin-spread stop
endif
endif
endif
REM SI ESTAMOS CORTOS
if shortonmarket then
REM SI HEMOS VENDIDO POR DEBAJO DEL MINIMO
if selltrend then
enter4 = 1
if enter1=0 then
buy PositionSize contract at abovemin+spread stop
endif
endif
REM SI HEMOS VENDIDO DENTRO DEL RANGO
if sellrange then
enter2 = 1
if enter3=0 then
buy PositionSize contract at abovemax+spread stop
endif
endif
endif
set stop ploss stoploss
set target pprofit profitrange