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

MQL4 エキスパート 統合

仕事が完了した

実行時間5 時間
依頼者からのフィードバック
I have received what i asked for and more. very solid work.

指定


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;

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

応答済み

1
開発者 1
評価
(336)
プロジェクト
620
38%
仲裁
39
23% / 64%
期限切れ
93
15%
2
開発者 2
評価
(1)
プロジェクト
2
0%
仲裁
1
0% / 100%
期限切れ
1
50%
3
開発者 3
評価
(62)
プロジェクト
140
46%
仲裁
19
42% / 16%
期限切れ
32
23%
4
開発者 4
評価
(71)
プロジェクト
254
53%
仲裁
16
50% / 38%
期限切れ
83
33%
5
開発者 5
評価
(3)
プロジェクト
5
20%
仲裁
1
100% / 0%
期限切れ
3
60%
6
開発者 6
評価
(548)
プロジェクト
825
73%
仲裁
15
53% / 13%
期限切れ
193
23%
仕事中
7
開発者 7
評価
(272)
プロジェクト
394
63%
仲裁
70
53% / 26%
期限切れ
198
50%
8
開発者 8
評価
(795)
プロジェクト
1365
72%
仲裁
112
29% / 48%
期限切れ
341
25%
仕事中
9
開発者 9
評価
(9)
プロジェクト
18
22%
仲裁
3
67% / 33%
期限切れ
4
22%
類似した注文
Hi I need a experience programmer to build me all harmonic pattern scanner indicator the must send alert with arrow on screen without open trades Multiple times frame H4 D1 W1 MN multiple currency pairs and i want to see all historical patterns that already happened
Pls if have a bos/ CHoCH indicator, about market structure when market changes character and when its down trend you can give me or create an indicator that knows market structure well simply if the market is on downtrend the indicator will know and if it’s on up trend the indicator will also know
I have two jobs actually. 1) I have source code and this one is based on getting signals and implementing. 2) I dont ave source code but you can view source code through any desk than compile those changes at your computer and at the time of implementation, you can do it thru anydesk. these are the changes i require in both: 1) Martingale strategy with manual settings , number of pips it, distance, profit can
Help needed 50+ USD
1. "Need help with my account! Assistance required ASAP!" 2. "Account assistance needed! Please help me resolve my issue!" 3. "Stuck with my account! Can someone lend a hand?" 4. "Account issues! Seeking help from a pro!" 5. "Help needed with my account! Please guide me through the process!"
Ceejay robots 50+ USD
Hllo ceejay I hope u can help me assistant plzz I'm depending on u I know I picked correct robot I know u got this I believe in u I know we can work together
Experience programmer needed who can build a sample double top and double bottom pattern indicator that send alert with arrow without open trades must send signal alerts only after the pattern confirm
I’m looking for a developer who can build a profitable EA for MT5. EA should have no major equity drops or daily drawdown. Looking for a solid trading system. NO martingale or Grid strategy EA should make around 10% a week Risk per trade should be 1% EA should use SL and TP
I am looking for a day trading bot with over 95% success ratio for gold and forex. It should use all the relevant strategies like moving averages (10, 20, 50), volume, RSI and trend into consideration and then generate buy and sell trade automatically with trailing SL and generate max profit
an ea that is based on a custom indicator, currently it works very fine but would like to add following... 1.make sure tp and sl values are calculated in points and are calculated from previous bar close (the one before our entry current bar) 2.check if a trade is already far from previous bar close than dont allow it, set the distance value in points (if current signal candle that is still formin and we would enter
I need a feature setup that will input the Sunday opening price as a horizontal ray on any chart and can be used by another EA as part of a trading strategy. Like this TradingView example below

プロジェクト情報

予算