Full Code || GOLD Trading Robot ||  90% win || Tight SL | Gold, Bitcoin, US Indices

Full Code || GOLD Trading Robot || 90% win || Tight SL | Gold, Bitcoin, US Indices

Scalping Robot Performance and Modifications

Overview of Scalping Robot

  • The scalping robot boasts a 90% win rate with a tight stop loss, making it effective for trading Forex pairs like USD/JPY, EUR/USD, and GBP/USD.
  • Today's focus is on modifying the EA (Expert Advisor) to work with Bitcoin, Gold, and US indices such as NASDAQ and DOW.

Backtesting Results for Bitcoin

  • A backtest was conducted on BTC/USD using a 5-minute chart from 2023 to present with an initial balance of €1,000. The test showed no running drawdowns due to the tight stop loss implemented.
  • Despite periods of consecutive losses and stagnation, overall performance improved significantly over time; ending balance reached €433,000 after testing.
  • The EA performs best during trending markets but struggles in sideways or choppy conditions where profits are minimal or stagnant.

Backtesting Results for Gold

  • Similar backtesting was performed on Gold using a 5-minute chart, starting from 2023 until 2024; results indicated no running drawdowns but included periods of stagnation and losses.
  • Ending balance after testing was approximately €24,000, with a win rate of 93% on short trades and 92% on long trades noted during optimal trading sessions (London/New York overlap).

Backtesting Results for NASDAQ

  • Testing on NASDAQ also showed no relative drawdowns; however, there were periods of stagnation similar to previous tests. Overall performance remained positive throughout the testing period.
  • The final balance reached around €24,000, with win rates at 92% for short trades and 91% for long trades, indicating strong performance primarily during US market hours.

Coding Modifications for New Markets

  • Transitioning into coding modifications required to adapt the EA for Bitcoin, Gold, and US indices involved creating distinct groups within the code: common trading inputs versus Forex-specific inputs.
  • Common variables include risk parameters like timeframe settings while Forex-specific inputs involve take profit (TP), stop loss (SL), trigger points which are unique to currency trading strategies.

Creating Input Variables for Trading Profiles

Defining System Types and Choices

  • The speaker introduces a variable named S type, which represents the system type, initialized to zero (Forex). This is linked to an enum with four dropdown values.
  • A new integer variable, system choice, is created to store user selections. The speaker plans to move the selection logic from the ontick function to the initialization function for better organization.

Initialization of Trading Profiles

  • A section dedicated to crypto-related inputs is introduced, specifically for Bitcoin profiles. Unlike Forex, Bitcoin prices are highly volatile.
  • Due to price fluctuations in Bitcoin, static stop losses are deemed ineffective; instead, users will input stop loss percentages based on current market prices.

Calculating Stop Loss and Take Profit

  • An example illustrates how a 1% take profit (TP) translates into specific point values based on current prices. For instance, at $60,000, a TP would be $600 above and below that price.
  • The speaker emphasizes creating separate profiles for different trading types (Forex, Gold, Indices), allowing easier tracking of percentage settings without needing constant adjustments.

Assigning User Inputs During Initialization

  • Once profiles are established with user-defined percentages for TP and stop loss triggers, these values will be assigned during initialization based on user selections.
  • The initialization function assigns system choice values according to user-selected types: Forex (0), Bitcoin (1), Gold (2), or Indices (3).

Managing User Inputs and Variable Assignments

  • Challenges arise when collecting user inputs since these variables cannot change during operations. Therefore, additional variables (TP point, SL point, etc.) are created as doubles.
  • These new variables will initially hold zero values but will later be populated with user inputs while keeping them distinct from operational variables used in executing trades.

Finalizing Initialization Logic

  • During initialization, default values from the Forex profile will populate these newly created variables until actual user input is collected.
  • The code structure ensures that operations run only upon opening a new candle while maintaining responsiveness during every tick event in trading activities.

This structured approach allows traders to manage their strategies effectively across various asset classes by leveraging dynamic input parameters tailored to market conditions.

Understanding Stop Loss and Take Profit in Trading

Setting Up Stop Loss and Take Profit

  • The process begins by multiplying the defined stop loss percentage by a variable related to crypto, establishing the order distance point as half of the stop loss points (e.g., 200 points becomes 100).
  • The logic is applied similarly for take profit (TP) and trailing stop loss (TSL), where TSL is calculated as a percentage of TP, allowing for dynamic adjustments based on user-defined parameters.
  • A conditional check is introduced to determine if the system choice equals two, which triggers specific calculations for gold trading, including obtaining ask prices and adjusting TP and SL accordingly.

Applying Logic Across Different Markets

  • The same methodology applies when dealing with indices; it involves fetching ask values and calculating TP/SL percentages based on market conditions.
  • This approach allows traders to create flexible profiles that can be optimized differently across various scenarios without needing to memorize values.

Key Considerations for Effective Trading

  • The modifications discussed are aimed at adapting a Forex Expert Advisor (EA) for use with Bitcoin, gold, and US indices while emphasizing that this method can extend to other assets like oil.
  • Important reminders include that no EA guarantees profits consistently; there will be periods of losses or stagnation. Success relies on favorable trading conditions outweighing unfavorable ones.

Market Conditions Impacting Performance

  • EAs tend to perform better in trending markets rather than chaotic or stagnant environments. Scalping strategies require tight spreads from brokers for effective execution.
  • Brokers must allow aggressive trailing stop-loss settings; otherwise, the strategy may fail. It's crucial to verify broker capabilities before relying on such methods.

Testing Strategies Effectively

  • Forward testing in real market conditions is essential to evaluate an EA's performance accurately. Backtesting alone does not provide a complete picture of effectiveness.
  • Future videos will introduce filters aimed at tightening trades further based on market indicators like moving averages or RSI levels, enhancing decision-making during volatile times.
Video description

If you want to download instead of following the video and coding: https://no-nonsense-forex-shop.fourthwall.com/ Still would suggest strongly to follow the video and code for yourself so you learn the logic as well. =========================================================== This is the 3rd part of this Automated EA Series where we look to convert the EA we wrote in the first 2 parts for Forex Pairs to BITCOIN, Gold and US Indices (Nasdaq and Dow Jones) We also introduce the elements of coding that the subsequent parts will detail all the way from downloading and installing Metatrader 5, how to get to Meta Editor 5 to start coding MQL to create the trading robot. Next parts will go step by step detailing additional FILTERS like RSI, Moving Averages, Major News and Events to filter out noise and not trade during certain market conditions. -------------------------------------------------------------------------------------- My Broker I have used ICMarkets for a very long time and never had to look anywhere else. If you do go that direction, use the code below to get extra discount on commissions/spreads https://icmarkets.com/?camp=83590 if you are already on ICMarkets, you can send an email to partners@ICMarkets.com and give them your account details and partner code 83590 to enjoy the discounts. =================================================================== Disclaimer: The content of the video are for the purpose of Forex and trading education purpose only. Forex and Trading is risky and the content of the video should be taken as educational material for forex and trading strategies only Please back test yourself all forex and trading education provided and found for reliability and education on forex trading and education 00:00 Intro 00:17 Backtest Gold, Bitcoin, Nasdaq 04:51 Coding of Modifications 15:15 Important Points 17:19 Next Video