• Welcome back! Thank you for being a part of this Traders Community. Let's discuss and share :)
    Selamat datang kembali! Trimakasih telah menjadi bagian dari Komunitas Trader ini. Mari berdiskusi dan berbagi :)

Suggestion Info: Gold Coin M5 EA

Di seguito trovi l'intero codice originale aggiornato con la modifica indicata (dove Terki = Steps();è sostituito da Terki = true ;). Non sono state apportate altre modifiche al codice originale.
Questa versione live funziona con la stessa logica del test.
 
Now I do not understand. Is it updated Revisionato C or updated original? If it updated iriginal - what is the difference with RevC?
LuigiM2604, please explain in more detail about this, and I would like to express my gratitude for the files you shared!Please tell me, the file where you corrected = true;in init() is this the same version posted earlier GOLD COIN REVISIONATO C.mq4 or the code according to the original Gold_Coin_fix.ex4 ?
 
Di seguito trovi l'intero codice originale aggiornato con la modifica indicata (dove Terki = Steps();è sostituito da Terki = true;). Non sono state apportate altre modifiche al codice originale.

upload_2024-12-29_9-33-47.png
upload_2024-12-29_9-31-25.pngupload_2024-12-29_9-31-35.png
 

Attachments

  • upload_2024-12-29_9-31-25.png
    upload_2024-12-29_9-31-25.png
    365.7 KB · Views: 182
  • upload_2024-12-29_9-31-35.png
    upload_2024-12-29_9-31-35.png
    206.1 KB · Views: 187
  • upload_2024-12-29_9-33-47.png
    upload_2024-12-29_9-33-47.png
    85.3 KB · Views: 187
  • GOLD COIN TEST=LIVE.mq4
    GOLD COIN TEST=LIVE.mq4
    35 KB · Views: 13
Last edited:
What did you want to show with this?

From my observations. In your first screenshot the name of the advisor is masked. I also tested it and it showed different results.
The EA file I tested is GOLD COIN TEST=LIVE.mq4
Yes, you test with different results because you are not using 99.9% tick data, so the result will not be same and not be accurate.
The ea name wasn't show doesn't matter,they are same file
 
I retested both files (Rev C and Test=live) with 99.9% tick data. Both failed miserably. I will wait until the markets return to normal in mid January and then try on live.
 
Di seguito è riportata un'analisi completa, passo dopo passo, del codice MQL4 fornito. Il codice sembra essere un Expert Advisor (EA) per MetaTrader 4 che piazza e gestisce le negoziazioni su un dato simbolo (probabilmente Gold, dati il nome e i riferimenti). Suddividerò la funzionalità in sezioni e spiegherò la logica, le variabili e le funzioni utilizzate.

Panoramica di alto livello:

  • L'EA tenta di gestire gli ordini (sia in sospeso che di mercato) su un dato simbolo.
  • Sembra che ci sia una differenza tra l'esecuzione in modalità test (Strategy Tester) e quella in modalità live.
  • Utilizza indicatori stocastici e indicatori SAR come parte della sua logica.
  • Dispone di una logica per gli stop dinamici, soglie di profitto/perdita e processi decisionali dinamici basati sulle recenti negoziazioni.
  • Cerca di rilevare quando il mercato è piatto (quando il massimo attuale della barra M1 è uguale al suo minimo) ed elimina determinati ordini in sospeso in quello scenario.
  • Tenta inoltre di ampliare le posizioni piazzando più ordini stop.
  • Ci sono riferimenti al concetto di "Terki" che indica se l'EA è in esecuzione in modalità tester o meno.
    Key Observations:
    1. Code Complexity: The code is complex, mixing multiple logic streams:
      • Testing mode vs. live mode behavior (Terki variable).
      • Multiple sets of conditions to place trades based on technical indicators (Stochastic, SAR, ADX).
      • Profit/loss thresholds that cause closure of all open trades.
      • Logic to handle abnormal conditions (like extremely large spreads).
    2. Potential Issues:
      • The code references MODE_FREEZELEVEL and MODE_STOPLEVEL directly in calculations (fsfwef = (int)MathMax(MODE_FREEZELEVEL,MODE_STOPLEVEL);) rather than using MarketInfo(). This might be intended or may lead to unexpected results since MODE_FREEZELEVEL and MODE_STOPLEVEL are constants used with MarketInfo() rather than variables themselves. Typically, one would call MarketInfo(Symbol(), MODE_FREEZELEVEL) or MarketInfo(Symbol(), MODE_STOPLEVEL) to get these values.
      • max is a double variable that never seems to be reset or managed. The code checks AccountEquity() > max conditions, but max is never updated within the logic after initialization. This may result in conditions that never trigger as expected.
      • The EA places multiple pending orders at once, which might not comply with some broker rules, and also may not have proper SL/TP initially.
      • The code uses Ask and Bid directly without ensuring that RefreshRates() is called. Usually, Ask and Bid should be updated with RefreshRates() before placing or modifying orders.
    3. Intended Strategy:
      • The EA seems to attempt a trend-following or reversal strategy based on indicators (Stochastic and SAR) and tries to pyramid into positions by placing multiple pending orders.
      • Profit and loss thresholds are quite large and might need adjusting.
      • If market goes flat (equal high and low on M1), it deletes pending orders that are unlikely to be triggered in the correct direction.
    4. Testing Mode Detection (Terki):
      • The code tries to detect if it's running in the tester by checking time progress. This is a heuristic approach and may not always be reliable.
    5. Graphical Output:
      • The code creates a text object "tyrelerfk_text" on the chart to indicate if the EA is allowed to trade or not, which can help with debugging.
    Conclusion:

    This EA uses multiple layers of logic and external parameters to place and manage trades. It:
    • Checks trends using ADX on multiple timeframes.
    • Uses Stochastic and SAR conditions for entry triggers.
    • Implements trailing stops, stop orders, profit/loss cutoffs.
    • Differentiates behavior based on a detected testing mode (Terki).
    The code is somewhat complex and may require careful debugging and refinement. It’s not fully clear what the final trading logic aims to accomplish, as it has multiple competing conditions. A user would need to run this in the Strategy Tester and observe logs to fully understand the flow and possibly simplify or clarify parts of the logic.
 
Impostando Terki = vero; nell'init(), l'Expert Advisor crederà sempre di essere in modalità di test e quindi eseguirà la stessa logica sia quando lo esegui in backtest (nel Strategy Tester) sia quando lo metti in esecuzione live su un conto reale o demo. In sostanza, sì: in questo modo il comportamento del test sarà replicato esattamente in live.
 
La strategia di funzionamento di questo Expert Advisor (EA) può essere risolta nei seguenti punti chiave:

1. Analisi con Indicatori TMA+CG
  • Il TMA (Triangular Moving Average) calcola una media triangolare del prezzo per creare una linea centrale.
  • Le bande superiori e inferiori sono calcolate aggiungendo o sottraendo una deviazione standard (definita da BandsDeviations) rispetto al TMA.
  • Il prezzo corrente viene confrontato con queste bande:
    • VENDERE : Se il prezzo supera la banda superiore.
    • ACQUISTA : Se il prezzo scende sotto la banda inferiore.
2. Controllo orario
  • L'apertura di nuove posizioni avviene solo durante due fasce orarie configurabili (UseTimeFilter attivo). Ad esempio:
    • Prima fascia: dalle 8 alle 12.
    • Seconda fascia: dalle 14 alle 18.
3. Apertura delle Posizioni
  • Posizioni principali:
    • Aprendo un ACQUISTO se il prezzo scende sotto la fascia inferiore.
    • Aprendo un SELL se il prezzo supera la banda superiore.
  • Filtro opzionale:
    • L'indicatore Stocastico può confermare il segnale:
      • ACQUISTO: Il valore dello stocastico è sotto il livello di ipervenduto.
      • VENDERE: Lo stocastico è sopra il livello di ipercomprato.
4. Apertura Aggiuntiva con Incremento dei Lotti (Martingala)
  • Se il prezzo si muove contro la posizione primaria (ad esempio, il prezzo scende ulteriormente dopo un BUY), il sistema apre una nuova posizione con un lotto incrementale (LotMultiplier).
  • La distanza minima tra l'apertura aggiuntiva è definita dal parametro AddPositionDistance.
5. Chiusura delle Posizioni
  • Chiusura su TMA (sempre attiva se CloseOnTmaCenter è true) :
    • Se il prezzo si avvicina alla linea centrale del TMA, chiude automaticamente tutte le posizioni aperte.
  • Arresto di fine corsa :
    • Aggiorna dinamicamente lo stop loss delle posizioni in profitto per proteggere i guadagni.
6. Gestione del Rischio
  • Ogni posizione ha uno stop loss (StopLoss) e un take profit (TakeProfit) definiti in punti.
  • La gestione incrementale dei lotti aumenta il rischio (strategia Martingale), quindi va usata con cautela.
 
Ho appena finito di scrivere questo codice. Lasciate stare questi ciarlatani venditori di spazzatura. Aiutatemi a ottimizzare il mio esperto e se avete qualche idea sui miei aggiornamenti
Luigi, you made a good point, I support you. But why did you choose these particular indicators for integration?
 
Ho appena finito di scrivere questo codice. Lasciate stare questi ciarlatani venditori di spazzatura. Aiutatemi a ottimizzare il mio esperto e se avete qualche idea sui miei aggiornamenti
upload_2024-12-30_9-28-18.png
M5 timeframe
 

Attachments

  • upload_2024-12-30_9-28-18.png
    upload_2024-12-30_9-28-18.png
    32.2 KB · Views: 140
Di seguito trovi l'intero codice originale aggiornato con la modifica indicata (dove Terki = Steps();è sostituito da Terki = true;). Non sono state apportate altre modifiche al codice originale.
upload_2024-12-30_10-17-54.png
 

Attachments

  • upload_2024-12-30_10-17-54.png
    upload_2024-12-30_10-17-54.png
    66.7 KB · Views: 147
Back
Top