Posts: 1
Please rate this topic Current rating: 0 Votes: 0
RSS
laert
Free Member
Offline
  • From: Brazil
  • Registered: 09-24-20
  • Posts: 1
  • Gender: male
  • Age: 44
  • Email

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&ccedil;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&ccedil;&atilde;o gale_lucro tera um limite de opera&ccedil;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&ocirc; 
               {      
                     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 )        ;
 
}
martingale.png 106.71 kb, 7 downloads since 2020-10-28 

What's new on MT4talk?

NEW! Daily MT4talk Artificial Intelligence (AI) Forex signals for manual trading.

It's simple! Receive the daily MT4talk AI Forex signals from MT4talk, then execute your trades, establish the recommended Take Profit (TP) and Stop Loss (SL), and relax. Your tasks for the day are complete.

The MT4talk AI Forex Signal works perfectly. See the latest earnings from MT4talk signal users.

We believe that the results of Forex signal users are the best way to demonstrate proof of profit.

MT4Talk Signal - 2023.12.05 - 3.10 profit
My today winning with the MT4talk AI Forex Signal 05.12.2023
MT4talk Forex AI Signal - EurUsd Sell Signal. Profit: $19.68
MT4Talk Signal - 2023.12.01 - 12.44% profit
Incredible AI Signals! 2023.12.01
I've made 30%+ today. 2023.12.01
Bad day today, only a 14.36% profit overall. :)
Profit from MT4Talk Signal - 2023.11.30

View past trading results by MT4talk PRO members...

Last Forum Posts
  • 10/12: The new MT4talk.com Trend Detector & Pip Hunter Forex Robot!
  • 10/12: How do you manage risk and avoid emotianal trading?
  • 10/12: Small Account, Which Timeframes Best for Forex?
  • 10/12: How to add screenshots see the screenshots to the forum posts?
  • 10/12: Learning Forex Trading Without Spending a Penny?
  • 09/12: Ilan 1.4: Visual Backtest with $200, 0.1 Lots
  • 09/12: Eye-Opening Insights on Forex Trading - Plus More!
  • 08/12: Small Drawdown, Big Gains: Charles-1.3.3 EA in Action
  • 08/12: Boost Your Trading: Ilan1.4 EA Optimization Tips Inside!
  • 08/12: Tailoring Orders: A Comprehensive Look at e-PSI@ManagerTrailing_v.2.5
  • 08/12: ForexFactory EA: Optimize for Best Pairs! Grider.ex4
  • 08/12: Enhanced Daily Open Strategy: Download Now!
  • 08/12: Unleashing OCTA SUPER EA: Swing, Scalp, News!
  • 08/12: Optimal Arbitrage EA Suggestions
  • 08/12: Navigating Forex: The Holy Grail EA for Real Gains
  • 08/12: how to pay tax for forex trading and how much?
  • 08/12: Profit Hunter EA - It's a super scalper EA!
  • 08/12: Moving Average Convergence Divergence (MACD): A Beginner`s Guide
  • 08/12: Basic Concepts VI: Types of Orders
  • 08/12: Basic Concepts III: History and Recent Trend of Online FX Market
  • 08/12: Top Scalping EAs: Share Your Picks!
  • 08/12: Scalper v5 + Wicks EA Inquiry - Any Recommendations?
  • 08/12: Effortless Profits: EA Blessing Configuration
  • 08/12: Enhance Your Strategy with Multi-StrategyiFSF EA: Expert Tips Inside!
  • 08/12: FX Safe Profit: Steady Income with Unique Trading Tech!
  • 08/12: Feedback Wanted: FXAlarms_14.12 EA Trial
  • 08/12: TFOT 3.0-EDU: Boosting Performance with Open Price
  • 08/12: USDJPY Sell, 8th December +33.96 USD
  • 07/12: XMT-Scalper v.2.46: Error-Free Operation – Seeking Guidance
  • 07/12: Basic Concepts II: Nature of the Foreign Exchange Market
  • 07/12: Basic Concepts I: Introduction
  • 07/12: Pips or points?
  • 07/12: Profitable Hedge EA: Optimal for Trending Currencies & Indices
  • 07/12: Proteção de EA: Bloqueio com Número de Conta
  • 07/12: Seeking Robust EA: Minimize Drawdown, Optimize Risk
  • 07/12: Seeking 24/7 Holy Grail EA: Low DD, $2K Start
  • 07/12: What's the most challenging part of Forex trading?
  • 07/12: Super pumped to be here!
  • 06/12: AI Signals 06.12.23 -1,68% profit despite difficult market conditions
  • 06/12: MT4Talk Signal - 2023.12.06 - 4.90$ profit
  • 06/12: Seeking Profitable VSA-Based EA
  • 06/12: VSA by the master the market e-book indicator
  • 06/12: Adaptive scalper - Inquiry
  • 06/12: Top Scalper: Consistent Profits for All Traders
  • 06/12: Daily Scalping: 100 Pips, Any Timeframe, Green Pips Guaranteed!
  • 06/12: Tick Scalper v3.4: Optimal for Fixed Accounts, 5min/15min TF
  • 06/12: ole$ya-PRO EA V.1
  • 06/12: In Search of Modified Martingale EA: Download Recommendations?
  • 06/12: safe martingale EA
  • 06/12: AIS2 Trading Robot: Auto Trading & Risk Control
  • 06/12: ibfx - Quick Buy: Powerful Forex EA for LQDFX and FXOpen
  • 06/12: zigzag1.mq4 Forex indicator download
  • 05/12: MT4Talk Signal - 2023.12.05 - 3.10 profit
  • 05/12: My today winning with the MT4talk AI Forex Signal 05.12.2023
  • 05/12: MT4talk Forex AI Signal - EurUsd Sell Signal. Profit: $19.68
  • 05/12: EU sell, 05.12. Profit: 27.40
  • 05/12: ilan1.4 (timefilter).mq4 - Proven Forex Robot for LQDFX and FXOpen
  • 05/12: EA Profit V11 Backtest - Unveiling Trading Efficiency
  • 05/12: Unlock Trading Success: Forex Indicator Predictor v2.0 Revealed
  • 05/12: Trend Signal Arrows: Master Your Buying and Selling
  • 05/12: Forex Millionaire Expert Advisor - Ideal for Any Market Condition
  • 05/12: Profitable EA: Download Super Robot Martin Now!
  • 05/12: Optimizing Robots for Live Profits: Stop and Target Tips?
  • 05/12: Pulp Fiction EA - Profit Unleashed: Pulp Fiction.ex4 Magic!
  • 05/12: Seeking Binary Option Indicator: Need Recommendations!
  • 05/12: EA Success: RONGGOLAWE - $2K Start, Pepperstone Razor, 5 Trades Max
  • 05/12: Maximize Gains, Minimize Risks with EA Fozzy
  • 05/12: Best EA for Arbitrage Trading?
  • 05/12: Trade-Arbitrage.mq4 - Powerful Forex EA for Consistent Profits
  • 04/12: Dragon Expert FF: 97% Gain, Default Settings
  • 04/12: Is Forex Trading on MT4 Right for Beginners? Tips and Strategies.
  • 04/12: How Can You Maximize Profits with Advanced Strategies in MT4 Trading?
  • 04/12: Exness Trading: Safe Deposits, Smooth Trading, No Instant Withdrawals?
  • 04/12: PZ Goldfinch EA: Tested for Success, Ending in Profits!
  • 04/12: What Are the Best Indicators for Forex Success?
  • Backtested Forex Robots & Setting Files
  • 23/02: RobotPowerM5 meta4V12 - (Tested with over $320,000 (129,000%) profit)
  • 06/03: MACD-STOCH Trader EA - (tested with over $380,000 profit)
  • 04/01: 35x20 sell7l200sl.mq4 Forex EA - (tested with over $690,000 profit)
  • 26/03: happy doji lucky hammer free EA - (Tested with over $1,800,000 profit)
  • 26/02: Great for GBPUSD!!! - (tested with over $9,600 (%1,900) profit)
  • 03/11: PROphet EA - (Tested with over $1,500,000 profit)
  • 23/11: PAKPET_EA - (tested with over $280,000 profit)
  • 29/01: macd_ma ea (for fixing) 2 - (Tested with over $1,500,000 profit)
  • 29/06: Pinball machine EA - (Tested with over $1,100,000 profit)
  • 30/06: RSI Trend Strategy - (Tested with over $2,600,000 profit)
  • 05/02: forex_mega_robot_eurusd - (tested with over $250,000 profit)
  • 03/03: 2MA cross ea - (tested with over $1,000,000 profit)
  • 31/01: Coramac_0001.mq4 Forex EA - (Tested with over $1,000,000 profit)
  • 13/09: AIS4 Trade Machine EA - (tested with profit $900,000+ (cent account))
  • 15/07: Scalper_GU - (tested with over $10,700,000 profit)
  • 28/09: "Conservative" EA double MA - (Tested with over %50 profit per month)
  • 22/07: BSS Full EA - (Tested with over $500,000 profit)
  • 08/11: ma_channel.mq4Forex EA - (tested with over $1,400,000 profit)
  • 27/12: EMVOL another sophia EA - (tested with over $1,000,000 profit)
  • 15/09: Farhad.mq4 Forex free EA - (tested with over $1,200,000 profit)
  • 13/02: CCI Cross Grid Expert Advisor - (tested with over $440,000 profit)
  • 08/09: EA based on Stochastic - (tested with over $7,100,000 profit)
  • 27/06: EMAplusWPRv1_1 EA - (Tested with over $4,600,000 profit)
  • 19/11: NEW - EA - Budak Ubat v1.51 - (Tested with over $100,000 profit)
  • 24/05: break 1mn[1].mq4 free Forex EA - (Tested with over $3,200,000 profit)

  • NOTE: You can only share open-source Forex robots on this platform. Sharing hacked or unauthorized versions of copyrighted Forex robots is strictly prohibited and can result in a ban on your account.

    By using the MT4talk website, you automatically agree to the Forum Rules & Terms of Use, as well as the terms below.

    Everything you see on the MT4talk website is created by its users, mainly the members of the MT4talk forum. The website doesn't sell Forex robots and doesn't provide support for the ones you download. MT4talk only offers a PRO membership, allowing you to download unlimited files from forum posts. Updates for the Forex robots may be limited or nonexistent, depending on the creator. If you choose to download any Forex robot or setting file from the forum, you acknowledge that you are using it at your own risk. MT4talk PRO membership is a digital product. Therefore, after you complete the PRO membership purchase, there is no refund available!


    We are conducting real-life tests on Forex robots to assess their performance. For certain robots, we may use a demo account to conduct tests, and for other Forex robots, we may use a real Forex account. It's essential to recognize that we are not financial advisors and cannot provide investment guidance. Our objective is to discover effective market analysis solutions through testing various strategies, which could be beneficial to 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 website may have links to partner websites, and if you sign up and trade through these links, we will receive a commission. Our affiliate partners are FXOpen, FBS, LQDFX, and MyForexVPS.


    Site map forums - Sitemap posts - Sitemap public search - Sitemap topics - Sitemap user posts - Sitemap user topics - Sitemap users

    Copyright MT4talk.com Forum Rules - Privacy Policy.