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

Trabajo finalizado

Plazo de ejecución 5 horas
Comentario del Cliente
I have received what i asked for and more. very solid work.

Tarea técnica


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;

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

Han respondido

1
Desarrollador 1
Evaluación
(336)
Proyectos
620
38%
Arbitraje
39
23% / 64%
Caducado
93
15%
Libre
2
Desarrollador 2
Evaluación
(1)
Proyectos
2
0%
Arbitraje
1
0% / 100%
Caducado
1
50%
Libre
3
Desarrollador 3
Evaluación
(62)
Proyectos
140
46%
Arbitraje
19
42% / 16%
Caducado
32
23%
Libre
4
Desarrollador 4
Evaluación
(71)
Proyectos
254
53%
Arbitraje
16
50% / 38%
Caducado
83
33%
Libre
5
Desarrollador 5
Evaluación
(3)
Proyectos
5
20%
Arbitraje
1
100% / 0%
Caducado
3
60%
Libre
6
Desarrollador 6
Evaluación
(548)
Proyectos
825
73%
Arbitraje
15
53% / 13%
Caducado
193
23%
Trabaja
7
Desarrollador 7
Evaluación
(272)
Proyectos
394
63%
Arbitraje
70
53% / 26%
Caducado
198
50%
Libre
8
Desarrollador 8
Evaluación
(800)
Proyectos
1371
72%
Arbitraje
112
29% / 48%
Caducado
341
25%
Trabajando
9
Desarrollador 9
Evaluación
(9)
Proyectos
18
22%
Arbitraje
3
67% / 33%
Caducado
4
22%
Libre
Solicitudes similares
Hello! I want to develop an indicator for tradingview. Daily closure (and 12H closure) should be available to show on the chart with a vertical line but daybreak is the standard. Every 12H closure will show a box above/below that candle on all timeframes up to D1, clearly showing which canle is the close of 12H (make that candle glow or something on lower timeframes). The box will contain info about which timeframes
I need help getting pineconnector working in mt5 the alerts from TV to mt5 work fine What is happening now is that if I am in a long position and a short position comes through it is not closing off the original position to only then keep the short position open. I have tried hedging - netting in the pineconnector settings but still no luck. The issue is that if I am in a long position and then alerts come through to
Hi I need access to Pocket option OTC charts where I can apply my tradingview indicator. I have the indicator but I need access to OTC charts to apply them! Please help
Tenho um endereço de API que retorna informações, a cada 1 minuto faremos uma consulta e mostraremos em um painel, é necessário validar se todos os tempos gráficos retornaram, em alguns momentos pode não retornar todos os dados. https://integra.tasdigital.com.br/GetIndicadoresForexDataAtualProducao/XAUUSD
Hi, Do you have an indicator or expert and would like to protect and control it? What you will get protection and control Customer control panel The number of products is unlimited. You can add any number of your own experts and consultations You can give a trial period for your product, for example a week or a month, after which the customer subscribes Monthly, annually, or for life, depending on the customer’s
I need an EA to automate Tradingview alerts on MT4 using webhook alerts. The bridge/connector should be python based GUI. Required features at a minimum Mapping Tradingview alert formats to MT4 Automating market, limit and stop orders with entry price, stop loss, multiple TPs and trailing stop Lot sizing - fixed/% of balance/fixed amount breakeven, partial close and trailing stop Mapping pair name prefixes/suffixes
Hello, I am looking for an experienced and professional developer to create a trade copier that transfers trades from MetaTrader 5 (MT5) to NinjaTrader 8 (NT8). I am looking for a developer with a strong track record in creating MT5 to NT8 trade copiers and who can deliver a robust and reliable solution. Thank you, and I look forward to your proposals
Hi there ,I am seeking for some who can I integrate MT4+MT5 into Matlab!We need our indicator window of MT4+MT5 viewable in Matlab so we can execute more research on Matlab Best regards Richie
NB: Given price is a placeholder only. Fees are negotiable. I’m looking for a developer who could make an expert advisor (EA) that will Auto copy telegram signals to an MT4 account. 1. Read and copy trading signals posted in specific telegram channels with different formats to MT4. 2. Copy all the signals including entry price, stop loss, and take profit levels 1 to 3 (if any). 3. Read customized messages on telegram
1. Combination of Market Profiles on daily basis a) this should be combined if the bell curve is similar to the previous day. Rotational day (volume - standard deviation). b) If breakout, new range should be drawn Conclusion: Market profile should be combined on daily after the market is closed 2. Use Vwap indicator, with 0.5 - slow trend, 1.0 - normal trend, 1.5 fast trend. The stop loss should be under the trend

Información sobre el proyecto

Presupuesto