I need conversion or rewrtiting of below Acttrader Strategy Code to a MQ4 EA

MQL4 Experts Integration

Job finished

Execution time 5 hours
Feedback from customer
I have received what i asked for and more. very solid work.

Specification


The strategy is quite simple as It uses two charts. The first 'Slow candle history' chart determines a trend, and the other 

'Fast candle chart' chart is used for moving average to enter in a market when the MA crosses a calculated signal price. if a close rate of 

previous candle from 'slow candle history' chart is closed above the open price of the candle, then the market is bullish. If a close rate of 

previous candle from 'slow candle history' chart is closed below the open price of the candle, then the market is bearish. 

The strategy calculates a size of previous candle from 'slow candle history' chart. After that the strategy takes the percentage 

part of that size and subtracts it from the open rate of the candle. As a result the strategy gets a signal price. 

When the moving average crosses the signal price the strategy will open a position. If the signal price is crossed from top to bottom the strategy 

will open a buy position. And vise versa if the signal price is crossed from bottom to top, the strategy will open a sell position.

Maximum currently opened positions are no more then one


The strategy settings:

'% of Slow Previous Bar Size' - percentage part of the previous candle from 'slow candle history' chart.


The strategy uses the following formula:

diff = previous_close_price - previous_open_price (from 'slow candle history' chart) ;

a = diff * Percentage_part;

signal_price = today_open_price - a;


there are defined s/l n t/p and prevention of opening more than one position at a time in below existing ActTrader script 

 

i would like to add some advanced  features regarding money preservation and runing profit optimisation instead of as now fixed s/l t/p. this can be done in a second step as i do have some code tht othewise works well


ACTTRADER SCRIPT WORKING:


const

StrategyName = 'super_combat'; 

StrategyVersion = '1.0'; 


var

SlowHistory, FastHistory: TCandleHistory; 

Account: TAccount;

Amount, Amount_sell, Percent: Double;

MA:TIndicatorScript; 

MA_set:TMovingAverage;

Stop, Limit, TraderRange:integer;

//////////////////////////////////////////////////////////////////////////////////////////////////////

procedure OnCreate;

begin

Settings.AddCandleHistory(@SlowHistory, 'Slow Candle History', '', CI_1_Day, 10);

Settings.AddCandleHistory(@FastHistory, 'Fast Candle History', '', CI_1_Hour, 100); 

FastHistory.OnNewCandleEvent:= @OnNewCandle;

FastHistory.OnNewRateEvent:= @OnNewRate; 

Settings.AddAccount(@Account, 'Account', ''); 

Settings.AddFloat(@Amount, 'Buy Amount (lots)', 1); 

Settings.SetFloatRestrictions(@Amount, 0, 10000, 1);

Settings.AddFloat(@Amount_sell, 'Sell Amount (lots)', 1);

Settings.SetFloatRestrictions(@Amount_sell, 0, 10000, 1);

Settings.AddFloat(@Percent, '% of Slow Previous Bar Size', 25); 

Settings.SetFloatRestrictions(@Amount, 0, 100, 1);

Settings.AddInteger(@Stop, 'Stop (pips)', 20); 

Settings.SetIntegerRestrictions(@Stop, 0, 10000, 1);

Settings.AddInteger(@Limit, 'Limit (pips)', 60); 

Settings.SetIntegerRestrictions(@Limit, 0, 10000, 1);

Settings.AddInteger(@TraderRange, 'Trader Range', 2); 

Settings.SetIntegerRestrictions(@TraderRange, 0, 10000, 1);

MA:= TIndicatorScript.Create(FastHistory, 'Moving Average', 'Moving Average');

MA_set:= MA.VariableValue('MA'); 

MA_set.Period := 1; 

MA_set.AverageType := makSimple; 

MA_set.CalculationType := cbClose;

end;

//////////////////////////////////////////////////////////////////////////////////////////////////////

procedure OnNewRate;

var signal_rate:double;

begin

signal_rate:= SlowHistory.Last(0).Open - ((SlowHistory.Last(1).Close - SlowHistory.Last(1).Open) * (Percent / 100));

if (MA.GetGraph(0).Last(1) > signal_rate) and (MA.GetGraph(0).Last(0) < signal_rate) and (NoPositions(bsBuy)) then begin 

CreateOrder(FastHistory.Instrument, Account, Amount, bsBuy,

FastHistory.Instrument.Sell - Stop * FastHistory.Instrument.PointSize,

FastHistory.Instrument.Sell + Limit * FastHistory.Instrument.PointSize, TraderRange, StrategyName);

log('buy signal rate = ' + FloatToStr(signal_rate));

end; 

if (MA.GetGraph(0).Last(1) < signal_rate) and (MA.GetGraph(0).Last(0) > signal_rate) and (NoPositions(bsSell)) then begin

CreateOrder(FastHistory.Instrument, Account, Amount_sell, bsSell,

FastHistory.Instrument.Buy + Stop * FastHistory.Instrument.PointSize,

FastHistory.Instrument.Buy - Limit * FastHistory.Instrument.PointSize, TraderRange, StrategyName);

log('sell signal rate = ' + FloatToStr(signal_rate));

end; 

end;

//////////////////////////////////////////////////////////////////////////////////////////////////////

// Defines is there any open Sell/Buy positions, opened by this strategy 

function NoPositions(pos:TBuySell): boolean;

var i:integer;

begin

result:= true; 

for i:= TradeList.Count-1 downto 0 do 

if (TradeList.Get(i).Tag = StrategyName) and (TradeList.Get(i).BuySell = pos) then 

result:= false;

end;

////////////////////////////////////////////////////////////////////////////////////////////////////// 

Responded

1
Developer 1
Rating
(337)
Projects
624
38%
Arbitration
39
23% / 64%
Overdue
93
15%
Free
Published: 4 articles, 19 codes
2
Developer 2
Rating
(1)
Projects
2
0%
Arbitration
1
0% / 100%
Overdue
1
50%
Free
Published: 1 code
3
Developer 3
Rating
(64)
Projects
144
46%
Arbitration
19
42% / 16%
Overdue
32
22%
Free
4
Developer 4
Rating
(71)
Projects
254
53%
Arbitration
16
50% / 38%
Overdue
83
33%
Free
5
Developer 5
Rating
(3)
Projects
5
20%
Arbitration
1
100% / 0%
Overdue
3
60%
Free
6
Developer 6
Rating
(561)
Projects
841
73%
Arbitration
15
53% / 13%
Overdue
193
23%
Working
7
Developer 7
Rating
(273)
Projects
396
63%
Arbitration
70
53% / 26%
Overdue
198
50%
Free
8
Developer 8
Rating
(840)
Projects
1437
72%
Arbitration
117
29% / 47%
Overdue
356
25%
Working
Published: 3 articles
9
Developer 9
Rating
(9)
Projects
18
22%
Arbitration
3
67% / 33%
Overdue
4
22%
Free
Similar orders
We are seeking a highly skilled MQL4 developer to complete a very complex EA project. Requirements & Conditions: Strict Timeline: 5 days delivery + 3 days rectification (non-negotiable) Must be free from other jobs and have strong history in complex EA development EA covers advanced features such as: Candle & HMA-based trade restrictions Multi-level breakeven, profit protection & profit trail Standard & Step trailing
Hi Devops, Convert Trading View indicator into MT4/MT5 EA.This EA has simple Buy/Sell trades based on TV indicator.It has basic inputs such as lot size:fixed/adding lot type,tp,SL,magic Number etc.More details will be discussed in private chat
Manage my live forex account with a disciplined, low-risk approach that produces steady monthly income. My priority is capital protection, so each trade must be sized conservatively, anchored by firm stop-loss orders, and designed to keep drawdown minimal. High-risk tactics such as martingale, grid systems, or excessive leverage are off the table; a measured, rules-based strategy is essential. I will connect the
I'm looking to build a trading bot. One that provides a 6% monthly return, and another that's a little more aggressive. NOTE: The bot could be 6% as a minimum; if it goes higher, it goes higher, with a floor of 9%. The idea is to be very conservative
Hello guys, I'm currently looking for a serious and well-tested EA that can help pass prop firm challenges (like FTMO, MyForexFunds, etc.) and eventually run on a funded account. Requirements: Max Drawdown: 1–2% per trade Lot Size: Adjustable based on the challenge account size Risk Management: On-chart panel showing all key stats (daily drawdown, equity, profit target, etc.) Stop Loss & Take Profit: Must follow
I need a lightweight, trend-following custom indicator coded for MetaTrader 4 that blends Moving Average, MACD, Bollinger Bands and Stochastic logic into a single tool. When all chosen conditions align, the indicator must fire a pop-up window and play an audible alert; email notification is optional but not required. All key parameters—periods, shifts, deviations, smoothing, alert switch, etc.—should appear in the
I already have an Expert Advisor coded in MQL4, but it refuses to trade anything other than its hard-coded symbol. I want that filter gone so the same strategy can fire on any instrument—forex, indices, metals such as XAUUSD—across any timeframe. The trading logic, money management and inputs must stay exactly as they are; I simply need universal symbol support. After the MT4 file is fixed and compiles cleanly, I
Description: Gildepak is a purchasing cooperative for packaging materials. We need a program to calculate and fairly distribute the annual bonus (received from preferred suppliers) among our member companies (partners and members). The program should work with a set of predefined tables and data flows, and it must be able to import and export Excel files. Main Tables: Member Companies Company ID Company Name Partner
Hi I am looking for a coder who can write me a code which picks up a pdf from my desktop and has it run through Claude with a pre-defined prompt. After that the result should be posted in a chat. This process needs to happen twice a day with different pdfs each day. In a stage 2 the bot should be fetching that pdf automatically from my inbox and run through the mentioend process. Work output needs to be a script that
Forex Signal Indicator 50 - 100 USD
I’m looking for an experienced Forex signal copier/trader who can copy trades from multiple signal groups into my live account during the London and New York trading sessions. I currently have access to 4 different Forex signal groups. The first step will be to analyze and test which group provides the best results and aligns with our trading goals. Once we identify the most effective group, you will copy the signals

Project information

Budget