GearTron Please make this code work as specified

MQL4 Experts

Specification

Introduction to GearTron

GearTron uses a Grid-based strategy. While many Expert Advisors that use a Grid-based strategy fail during significant market movements, this is where GearBox shows superior algorithms and logic.

Based on data, a person can "Choose the Gear Entry" and wait until a long trend ends to enter a position right before a pullback. As an advanced GearBox user or someone who understands trading, the strategy being employed can be “tweaked” by adjusting the settings, so there is a lot of flexibility and power in your hands. 

GearTron is a Counter Trend Trader, which means GearTron predicts the end of a long trend that a currency has taken. On the reversal of that trade, GearBox wants to execute trades knowing the trend has reversed. This is where the word “Gear” is important to understand. The higher the “Gear,” the more accurate the trade.

Additionally, GearTron has been created with the ability to execute Ghost Trades on the same long trend mentioned in the last paragraph to diagnose where an account would typically enter drawdown. Here, GearTron attempts to execute trades in the real market before the pullback or retracement. These Forex Pairs are the best-performing options for GearBox: USDCAD, EURUSD, AUDUSD, EURAUD, GBPNZD, and NZDUSD.

GearTron is designed to work with any currency pair, but you will need to know the average range that currency pair moves before a retracement!

With that knowledge, advanced users can design some great setups.

NOTE: You will notice that a number settings are available for editing but are labeled for advanced users. The Geartron Developer has made the available but make sure you know what you are doing if you choose to edit them. 

 

GearTron Settings

Expert Settings

image4.png

Weekly Goal (%)

Watch video

Default - 100%

Do you have a profit goal for the week? Would you like to lock in x% for the week and have the software turned off, so you don’t risk loss? 

This is a percent goal you can set that will allow you to exit the market when you are in this percent of “Floating equity” in the current trading week.

 

Max Equity Risk (%)

Watch video

Default - 100%. (it is recommended to change this)

How much are you willing to lose at any time? If you were to experience a large trade on a long trending trade that put your account at risk, when would you “cut the cord?” This is an integral part of a trader’s overall risk management. (It is essential to understand expected drawdowns on a swing trade.) 

Enter the value of the Maximum amount of Equity you are willing to risk before GearBox closes all trades. 

For example, setting the Max Equity risk to 30% means that once your overall drawdown reaches 30% of your account balance between one or more trades, GearBox will close all trades immediately to protect the account from further losses. 

 

Stop Running After Max Risk Hit

Default - Yes

Once an account’s Max Equity risk is reached and all your trades are closed, you can determine if you want GearBox to continue trading.

  • Yes - GearBox will continue to analyze markets and execute trades according to the settings. 
  • No - GearBox will not enter into any trades until receiving further instructions from the user.  

 

Starting Lot Size

Watch video

Default - 0.01 

The value entered here is the lot size of the first trade in a potential sequence.

GearBox allows you to adjust your lot size with extreme accuracy by basing it on your account balance. This is an essential aspect of proper risk management.

If you want to trade with a .01 per $1000 lot size and your account balance is $10,000, you will need to use the following formula to determine the value to enter into the Starting Lot Size field. 

  • Lot Size = (Account Balance / 1000) x 0.01
  • Lot Size = (10,000 / 1000) x 0.01
  • Lot Size = (10) x 0.01
  • Lot Size = 0.1

 

Let's say you want to trade with a lot size of .01 per $2500 to be conservative on an account with a balance of $55,000. Let's work through the formula we already used with the new numbers. 

  • Lot Size = (Account Balance / 2500) x 0.01
  • Lot Size = (55,000 / 2500) x 0.01
  • Lot Size = (22) x 0.01
  • Lot Size = 0.22

 

Here is a guide to the selection of a lot size for use.

  • .01 to 1000 - This is a standard formula for accounts up to $10,000.
  • .01 to 1500 - This is a standard formula for accounts from $10,001 to $25,000.
  • .01 to 2000 - This is a standard formula for accounts from $25,001 and above.
  • .01 to 3000 - This is an ultra-conservative formula for accounts above $10,000.

Beginning users typically set a value of .01 per $1,000-$3,000. 

There are two items that you should consider in selecting a lot size. 

First, what is your risk tolerance? A more aggressive lot size of .01 per $1,000 or less can secure more profits but will likely experience higher drawdowns. 

The second item to consider is your selection of mode to run GearBox. Swing mode can get more trades, but they are less accurate than Sniper or Super Sniper trade entries. 

Intraday users will frequently go as conservative as .01 per $5,000.

 

Starting Lot Enters On 

Default - Real Trades

  • Real Trades - The first trade you see on your account will be your starting lot size. This is the more conservative approach of the two options
  • Ghost Trades - GearBox will enter the starting lot in “The Ghost Server.” This setting is for advanced users and should not be used without proper education. 

 

Range Between Gears

Default - 21.0

Changing this value is for an advanced user who preferably understands trading. 

Someone you know who uses GearBox may also give you settings, but it is essential to know what those settings will do and what you may expect.   

 

Max Number of Gears

Watch video

Default - 8

If you add GearBox directly to a chart the default shows as 8. Adjusting that number is something that should be reserved only for advanced users.  

In the majority of cases the GearBox Manager should be used and it will apply the value for Max Number of Gears automatically based on the mode selected; swing, sniper, or  super sniper. After using the Manager and applying the mode you can see the value applied by GearBox by clicking the GearBox icon in the top right corner of the chart. 

image6.png

On volatile pairs with a high gear entry, setting this to 13 is suggested.  

On more stable pairs, the pairs listed above that GearBox is optimized for, using a setting of 11 is common.

 

Moving Average Period

Default - 20

This is one method the software uses to determine the trade's direction (buy or sell). 

The lower the value entered here, the less accurate GearBox will be. 

 

Range Multiplier 

Watch video

Default - 1.35

This is the distance, in pips, between Gear entries. This is an advanced feature and adjusting this should only be done with an understanding of the impact of changing it. 

For example, you start at 21 pips, and if you use a multiplier of 1.35, the distance between Gear 0 and 1 will be 28 pips.

 

Max Pairs Trading at Same Time 

Watch video

Default - 3

This is the maximum number of pairs you will allow GearBox to trade at one time.

The more pairs that are allowed to be traded at the same time, the more drawdown an  account will experience. 

If an account will allow trades to be taken in many pairs, it is highly recommended that it forbid opening trades of correlating pairs. 

 

Forbid Opening Trades of Correlating Pairs

Default - Yes

  • Yes - If the value is set to Yes, Gearbox will not allow pairs 85%+ correlated with taking trades going in the same direction or trades that are 85%- correlated going in the opposite direction. This is a very feature for risk management and is recommended to use. 
  • No - If the value is set to No, there is no filter to prevent trades of correlating pairs from being taken.

 

 

Trailing Stop Settings

image11.png

Enable Trailing Stop 

Default - Yes

If the value is set to Yes, Gearbox will activate a Trailing Stoploss at your chosen Take Profit Price + your hedge amount. If the value is set to no, there will not be any trailing stop loss activated.

 

Trailing Stop for Hedge Trade

Default - 25

This is the number of pips beyond take profit you want the trail to activate; then it will trail up every one pip in the correct direction beyond 25 pips, for example.

 

 

Gears Above Settings

Watch video

image7.png

Only Gears Above

Default - 2

The value you enter here will determine the minimum gear that trades must reach before they are allowed to be taken in the live market.

 

Autochange Gears Above

Default - Yes

If you would like to allow GearBox to auto-change the gear that must be reached to enter into a trade, the value set in the previous setting, you can select it here. 

  • Yes - GearBox will be allowed to auto-change the Gear. 
  • No - GearBox will not be allowed to auto-change the Gear. 

Some users will allow a change on certain days of the week. This can be controlled in the following setting. 

 

Auto Change On

Default - Wednesday

If you have selected yes to the previous setting, use this value to select the day you want to allow a change. If you have Wednesday selected then the auto change will be active from Wednesday through Friday. It will then turn off from Sunday to Tuesday and turn back on Wednesday again. 

 

Change to Gears Above

Default - 3

If you are not allowing an auto change, this setting will not be active. If you have allowed an auto change of the gears and have chosen the day to allow it, then in this field, you will set the gear you want to allow GearBox to enter.

For example, suppose you put 6 here. In that case, you can only enter 7 and beyond in the real market.

 

Pro Settings

image10.png

Restart Gear Range with First Real Trade

Default - No

  • Yes - If you have this feature turned on and you enter a Gear 6 trade, the next trade would be entered at the gear 1 level. This is another advanced feature that should only be used when a thorough education of the feature is obtained.  
  • No - GearBox will run without restarting to the first real trade. 

 

Close Basket at Max Number Gears

Default - No

  • Yes - This feature is a per pair equity protector instead of a global equity protector. For example, if you want to trade a volatile pair along with the standard pairs, you can set an equity protector just for that pair. This is an advanced setting to be used once it is well understood. 
  • No - No pairs are specifically being monitored. It is assumed that you are using the Global Equity Protector for your entire account. 

 

Stop-Loss Settings

Watch video

image5.png

Stop-Loss Distance

Default - 500

You can set any stop-loss amount that you want, expressed in pips.

 

Ghost Trade Settings

image13.png

Delete Ghost Trades at the Start of Week

Default - Yes

  • Yes - Having this on creates more accuracy in your trade as it is based on news events this week. It is recommended to have this turned on.   
  • No - You will get more trades but the risk of drawdown increases due to less accuracy with the trades being entered.

 

Take Profit Settings

Watch video

image1.png

Take Profits Based on 

Default - Real Trades Double TP

  • Real Trades Only - With this setting, the default TP is 30 pips. 
  • Real Trades Double TP - This value doubles the default 30 pips, equalling 60 pips. 
  • Ghost Trades + Real Trades - This is a calculation of what Ghost Trades + Real Trades would need to be profitable on an entire sequence.
  • Custom TP on First Real Trades (Input a number) - The default is Real Trades Double TP, which is 60 pips. This setting allows you to set a lower TP than 60 pips. You can use this on a per pair basis. Using this can increase your win ratio but will lower your profitability since you are catching fewer pips per trade.  

 

Notification Settings

Watch video

image8.png

Notifications of Drawdown

Default - Percent

  • Off - No notifications will be sent to you regarding drawdown. 
  • Percent - Set a value to activate a drawdown notification when a specific percentage of your account is reached in the drawdown. 
  • Absolute - Set a value to activate a drawdown notification when a specific monetary amount of your account is reached in the drawdown. 

 

First Notification Amount

Default - 10

If you have notifications turned on using the setting above, you will use this value to specify when you want to be notified of the drawdown. The value you enter will be seen as a percentage or fixed number based on the value you selected above, Percent or Absolute.

 

Second Notification Amount

Default - 20 

If you have chosen to get notifications, you can use this to get a second alert at a second value if you choose. You may want to know when your drawdown goes from 1% to 2% or if the dollar amount goes from $50 to $100. 

 

Balance Protection Settings

Watch video

image9.png

Balance Protection Active

Default - Yes

  • Yes - Choose this value if you want to implement balance protection on your account. 
  • No -  Choose this value if you don’t want to have balance protection active on your account.

 

Balance Protection Mode

Default - Percent

If you have chosen Yes, to have Balance Protecting active, please choose how you want to express your protection. 

  • Percent - Choose this option if you want to use a percentage value for account protection. 
  • Fixed -  Choose this option if you want to use a fixed dollar amount for account protection. 

 

Balance Protection Value

Default - 25.0

If you are using Balance Protection, enter the numerical value you want to use for your protection. In the following setting, you chose to have your account balance protected by either a percentage or absolute dollar amount. Please remember that when choosing your value here. 

Note: This feature does not close your trades but does not allow any further new trades to be taken when the account balance protection is reached. If you want to have all of your trades closed at a specific drawdown amount, you will need to use the Max Equity Risk feature. 

 

Trading Times

Watch video

image3.png

Wait 2 Hours After Market Open

Default - Yes

  • Yes - This is the default selection recommended due to high spreads when the markets first open on Sunday evening.  
  • No - You can choose to allow GearBox to start trading right at the time of market opening. 

 

Trade on Sunday-Saturday

Default - Yes




// Define global variables for notification settings
int firstNotificationAmount = 10; // Default - 10
int secondNotificationAmount = 20; // Default - 20

// Define global variables for balance protection settings
bool balanceProtectionActive = true; // Default - Yes
int balanceProtectionMode = 0; // Default - Percent (0 for Percent, 1 for Fixed)
double balanceProtectionValue = 25.0; // Default - 25.0

// Define global variables for trading times settings
bool wait2HoursAfterMarketOpen = true; // Default - Yes
bool tradeOnSundayToSaturday = true; // Default - Yes

//+--------------------------- ------------------------------ ---------+
//| Expert initialization function                                   |
//+--------------------------- ------------------------------ ---------+
int OnInit()
{
   // Load settings from inputs or external files here
   int weeklyGoal = 100;  // Default - 100%
   double maxEquityRisk = 100.0;  // Default - 100%
   bool stopAfterMaxRiskHit = true;  // Default - Yes
   double startingLotSize = 0.01;  // Default - 0.01
   // ... add more settings

   // Initialize and set parameters based on settings
   // ...

   return(INIT_SUCCEEDED);
}

//+--------------------------- ------------------------------ ---------+
//| Expert deinitialization function                                 |
//+--------------------------- ------------------------------ ---------+
void OnDeinit(const int reason)
{
   // Perform any necessary cleanup here
}

//+--------------------------- ------------------------------ ---------+
//| Expert main function                                            |
//+--------------------------- ------------------------------ ---------+
void OnTick()
{
   // Main trading logic goes here
   // ...

   // Check if weekly goal is met and close positions if necessary
   // ...

   // Check for max equity risk and take appropriate action
   // ...

   // Check if trailing stops need to be activated
   // ...

   // Check notification settings and trigger alerts if necessary
   if (AccountFreeMarginCheck( Symbol(), OP_BUY, 0.01) < AccountBalance() * firstNotificationAmount / 100) {
      SendNotification("First notification triggered");
   }
   if (AccountFreeMarginCheck( Symbol(), OP_BUY, 0.01) < AccountBalance() * secondNotificationAmount / 100) {
      SendNotification("Second notification triggered");
   }
}

// Add other necessary functions (e.g., trade execution, position management, etc.)

   


Responded

1
Developer 1
Rating
(196)
Projects
200
28%
Arbitration
0
Overdue
3
2%
Working
2
Developer 2
Rating
(9)
Projects
4
0%
Arbitration
11
0% / 82%
Overdue
0
Free
3
Developer 3
Rating
(1)
Projects
1
0%
Arbitration
3
0% / 100%
Overdue
0
Working
Similar orders
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Helvetica Neue'} Hello Looking for someone to help me improve my current strategy on my own algorithm and to also add hedging mode
I want the script in mql5 language for my martingale strategy. The script should open trades in both directions buy and sell and if any trade closes in loss then open new trade in that direction by using the next volume and when trade closes in profit then reset the volume to first from volume list and also maximum consecutive losses limit will apply. If trades closes consecutively in losses and hits the limit then
Long Position 1. Trend Line: When a Lower High (LH) is formed, draw a trend line from the previous Higher High (HH) to the new LH. 2. Trend Line Adjustment: If a new Lower High (LH) is formed without breaking the trend line, redraw the trend line to the new LH. Draw a trend line between the Higher High (HH) and the Higher Low (HL). If a new Higher High (HH) is formed, remove the previous trend line and draw a new one
Please watch the video on this youtube channel and download the Indicator from there. https://www.youtube.com/watch?v=ldTomLu8DxE&amp ;t=32s Rules are explained on the video and the download of the indicator is on the same video
I would like an EA that follows exactly this steps to trade de daily candle. Watch the video and then see if you can do the task. https://www.youtube.com/watch?v=g3oDYq4P9ZE Document is one this link https://cdn.discordapp.com/attachments/1135977927469703230/1135978751461695598/Daily_Bias-TTrades_edu.pdf?ex=669a9a27&amp ;is=669948a7&hm=96de195f7e695a381c1261b065f67b94fae319d02a0c88641b146f8b2978320c& Should have
I have a custom EA that works fine in the live market trading, but when doing a back test in the strategy tester , it does not open sell orders. There are no errors or warnings; it just doesn't open sell orders. I've checked every possible reason that might be the reason why it does not open sell orders, but I can't find anything, especially since it works fine in the real market and it opens both buys and sells
Hi, I have an indicator from my friend, I want to copy it to my own MT5 can you do that for me. Here is the link
I installed the E.A. into the Experts folder in MT4. When I double click on it nothing happens. When I right click and "attach to chart" nothing happens. The E.A. is not grayed out, it simply will not attach. Any help would be greatly Appreciated
I have an EA and want to add few new logic to fetch profit taking factors and other values from an external master data and use it in existing EA
Hello Every one, Good day, I want from someone professional to create an EA is working on Mt5, This EA is working by depend on some indicators, and all those indicators must be working on MACD window, not on the chart, for more details please read my attached pdf file carefully. Many Thanks

Project information

Budget
30+ USD
For the developer
27 USD