Log in or register to download unlimited Forex robots!
Martingale um pouco diferente.
Ja faco uso do robo Ilan 1.6 conhecido por muitos.
Quero acrescer um martingale um pouco diferente.
Estou tentando por uma so funcao martingale, tanto para lucro quanto para percas. Valores dessa funcao serao recebidos como parametros.
Dentro dessa funcao global de martingale teremos as opcoes de gale_lucro e gale_perca, sendo essas variaveis externas do tipo bool, pois quero ter a opcao de habilitar ou nao. Podendo trabalhar separadas, as duas juntas, ou ate as duas desabilitadas.
Ja criei o codigo mas nao funciona quando as duas as opcoes gale_lucro e gale_perca estao marcadas como true.
Preciso que uma unica variavel receba os valores dessa funcao martingale. Ver imagem em anexo.
A ideia e que na funcao start (), quando chamado o OrderSend , campo referente a lote seja colocado essa variavel que ja possui a logica do gale_lucro ou gale_perca.
Gale_lucro : criar limitador de quantidade como uma variavel externa
Gale_perca : criar limitador de quantidade como uma variavel externa
.........................................................
Exemplo de funcionamento do robo:
Considera-se habilitadas as opcoes de gale_lucro e gale_perca.
Lote inicial 0.01
1 operacao profit < 0 - [ gale-perda] Essa funcao ira multiplicar pelo fator multiplicador ( variavel externa ex. 1.4 ) e fazer o calculo.
2 operacao profit < 0 - a funcao gale-perda tera um limite de operacoes, ex. ate lote <= 20 e recomeça o ciclo do gale-perca
3 operacao profit > 0 - lote retorna ao lote inicial 0.01
4 operacao profit > 0 - [ gale-lucro] Essa funcao ira incrementar pelo fator ( variavel externa ex. 0.01 ) e fazer o calculo 0.01+0.01.
5 operacao profit > 0 - a função gale_lucro tera um limite de operaçoes ex. ate lote 0.03. Nesse ex aqui sera calculado 0.02+0.01
6 operacao profit > 0 - lote incrementa chega no limitador, pois ja alcancou o lote 0.03.
7 operacao profit > 0 - lote retorna ao lote inicial 0.01
8 operacao profit > 0 - [ gale-lucro]
9 operacao profit < 0 - [ gale-perda]
Deixo abaixo a funcao por mim escrita, peco orientacao quanto ao que estou errando, desde ja agradeco.
duplo martingala ( duplo lote_inicial , duplo fator_incremento , duplo fator_aumento , int Magicma_n ) {
/ * lote_inicial = 0 , 01 , fator_incremento = 1 , 4 , fator_aumento = 0 , 01 * /
tamanho_lote duplo = 0 ;
int maior_ticket = 0 ;
lote duplo = 0 ;
double maior_lote = 0 ;
lucro duplo = 0 ;
para ( int i = 0 ; i < OrdersHistoryTotal ( ) ; i ++ )
{
if ( OrderSelect ( i , SELECT_BY_POS , MODE_HISTORY ) == false )
break ;
if ( ( OrderSymbol ( ) == Symbol ( ) ) && ( OrderMagicNumber ( ) == Magicma_n ) ) // verifica a moeda, qual robô
{
if ( OrderTicket ( ) > maior_ticket )
{
maior_ticket = OrderTicket ( ) ;
maior_lote = NormalizeDouble ( OrderLots ( ) , 2 ) ;
lucro = OrderProfit ( ) ;
}
}
}
if ( OrderSelect ( maior_ticket , SELECT_BY_TICKET , MODE_HISTORY ) == false )
return ( lote_inicial ) ;
if ( maior_lote == 0 )
tamanho_lote = lote_inicial ;
// -------------
if ( ( gale_perca == false ) && ( gale_lucro == false ) ) {
if ( ( lucro > 0 ) || ( lucro < 0 ) )
tamanho_lote = lote_inicial ;
}
if ( ( gale_perca == false ) && ( gale_lucro == true ) ) {
if ( profit > 0 )
tamanho_lote = maior_lote + fator_lot ; //
else if ( profit < 0 ) tamanho_lote = lote_inicial ;
}
if ( ( gale_perca == true ) && ( gale_lucro == false ) ) {
if ( profit < 0 )
tamanho_lote = maior_lote * fator_incremento ; //
else if ( profit > 0 ) tamanho_lote = lote_inicial ;
}
// ----------------------------------------------- ------------------- //
if ( ( gale_perca == true ) && ( gale_lucro == true ) ) {
if ( lucro < 0 ) {
if ( lote_inicial == loteentrada ) {
tamanho_lote = maior_lote * fator_incremento ;
if ( lucro > 0 ) tamanho_lote = lote_inicial ;
}
}
// ----------------------------------------------- --------------------
if ( lucro > 0 ) {
tamanho_lote = lote_inicial ;
if ( tamanho_lote == lote_inicial )
tamanho_lote = tamanho_lote + fator_lot ;
if ( lote_inicial ! = loteentrada ) {
tamanho_lote = maior_lote + fator_lot ;
if ( lucro < 0 ) tamanho_lote = maior_lote * fator_incremento ;
if ( lucro > 0 ) tamanho_lote = lote_inicial ;
}
}
}
lote = NormalizeDouble ( tamanho_lote , 2 ) ;
return ( lote ) ;
}
- Total number of registered users: 76,815
- Registered users today: 14
- Newest registered user: PECUNIAE
- Total number of topics: 11,764
- Total number of posts: 38,411
Online users: 2,949 guests, 107 Members:
@zoel1512, admin, Alex Ezekiel, Alex Tahnat, am55555, Amylia, angelj, antoine_castier, archangpy, arnie, Asbu, aslam, asrico, aussiesteve, Biren, CapeStar, chemphut, chizzy97, davidgoure, diversanta, dnxnxz, Donatello2, Duecebillion, Eac0046, Edgar Seraphin, ela, Emka, Emmanuel Vulfersthawisky S, emmie789, esejuliete, Etsenn, fahmiop, Gal Gadong, GatePiyush0304, Gil111007, gnfarshad, Hai Ma, heritzin82, hghspd01, hhh45, Home, HS Bhiks, Hüseyin Gökhan Oruçoğlu, IamSolomonChika, IB, ihate, jarexx, Jaymatic1, jclint394, jeutouf, jibaku, JonKon, King Thubela, Kyos Tebogo, Lars Dalgren, Makis Stamat, Manuel Sopena Canals, MARCOS2022, Marzenchi, Matjoe, mb56, MD Milon Mia, MHA, Micky, mifa, minhtu599, Mrmax2101, neagoelaur, nitroz, obdx02, Owethu Mkhize, patriks87, PECUNIAE, pedropascal, pedroza_edgar01, pigboy, PipsGone, pipsseeker, Purgeaudio, Reno, reyhanihza, Riandy Mohamed, rprabhakaran123, Salvatore De Fazio, shinryu3000, simonjackson2018, sonel, spark2023, Terry_Bkk, ThreeLions, tn_rockstar, trader.user1980, traders, Tulin, Viet Anh Nguyen, vizayrazu, Vũ Thanh Tùng, wagnerg123, wenwei.pan, woodya22, xv16, yekokonyein, ytrade, Zaeda77, Zoltan0013, نذري بن حسن, 西伯利亚风
MT4talk is a User Generated Content website. All content uploaded to MT4talk by our users (MT4talk forum members) is User Generated Content. Please note that MT4talk doesn't sell Forex robots and does not provide support for the uploaded Forex robots. MT4talk only sells PRO membership. PRO membership means unlimited download access in every forum topic and forum post. While some of the uploaded Forex robots are limited till the next update, other robots never get updated, it all depends on the creator of the robot.
We testing Forex robots in REAL-TIME! We testing some robots on a demo account but in real-time. We are not financial consultants and we can't push you to risk your money. We are just trying to find good market analysis solutions from different strategies to help our community.
CFTC RULE 4.41 – HYPOTHETICAL OR SIMULATED PERFORMANCE RESULTS HAVE CERTAIN LIMITATIONS. UNLIKE AN ACTUAL PERFORMANCE RECORD, SIMULATED RESULTS DO NOT REPRESENT ACTUAL TRADING. ALSO, SINCE THE TRADES HAVE NOT BEEN EXECUTED, THE RESULTS MAY HAVE UNDER-OR-OVER COMPENSATED FOR THE IMPACT, IF ANY, OF CERTAIN MARKET FACTORS, SUCH AS LACK OF LIQUIDITY. SIMULATED TRADING PROGRAMS, IN GENERAL, ARE ALSO SUBJECT TO THE FACT THAT THEY ARE DESIGNED WITH THE BENEFIT OF HINDSIGHT. NO REPRESENTATION IS BEING MADE THAT ANY ACCOUNT WILL OR IS LIKELY TO ACHIEVE PROFIT OR LOSSES SIMILAR TO THOSE SHOWN.
Disclaimer - No representation is being made that any Forex account will or is likely to achieve profits or losses similar to those shown on backtests in this forum. In fact, there are frequently sharp differences between hypothetical performance results and the actual results subsequently achieved by any particular trading program. Hypothetical trading does not involve financial risk, and no hypothetical trading record can completely account for the impact of financial risk in actual trading. All information on this forum is for educational purposes only and is not intended to provide financial advice. Any statements posted by forum members or the MT4talk EA Tester Team about profits or income expressed or implied, do not represent a guarantee. Your actual trading may result in losses as no trading system is guaranteed. You accept full responsibilities for your actions, trades, profit or loss, and agree to hold the MT4talk team and forum members of this information harmless in any and all ways.
Affiliates Disclaimer - The site may contain links to affiliate websites, and we receive an affiliate commission for any sign up that trade by you on the affiliate website using such links. Our affiliate partners includes the following: FXOpen, FBS, LQDFX, MyForexVPS.
Copyright MT4talk.com Forum Rules - Privacy Policy.