명시

//+------------------------------------------------------------------+
//| SimpleMA.mq5 |
//| Auto trading bot example |
//+------------------------------------------------------------------+
#property copyright "ChatGPT"
#property link ""
#property version "1.00"
#property strict

input int FastMAPeriod = 10;
input int SlowMAPeriod = 30;
input double Lots = 0.1;

int fastMAHandle;
int slowMAHandle;

double fastMA[];
double slowMA[];

int OnInit()
{
// Create handles for moving averages
fastMAHandle = iMA(_Symbol, PERIOD_CURRENT, FastMAPeriod, 0, MODE_SMA, PRICE_CLOSE);
slowMAHandle = iMA(_Symbol, PERIOD_CURRENT, SlowMAPeriod, 0, MODE_SMA, PRICE_CLOSE);

if(fastMAHandle == INVALID_HANDLE || slowMAHandle == INVALID_HANDLE)
{
Print("Failed to create indicator handles");
return(INIT_FAILED);
}

return(INIT_SUCCEEDED);
}

void OnDeinit(const int reason)
{
IndicatorRelease(fastMAHandle);
IndicatorRelease(slowMAHandle);
}

void OnTick()
{
// Copy data for the last 3 bars (to check crossover)
if(CopyBuffer(fastMAHandle, 0, 0, 3, fastMA) <= 0) return;
if(CopyBuffer(slowMAHandle, 0, 0, 3, slowMA) <= 0) return;

double fastPrev = fastMA[1];
double fastCurrent = fastMA[0];
double slowPrev = slowMA[1];
double slowCurrent = slowMA[0];

// Check if there is already an open position
int totalPositions = PositionsTotal();

bool buySignal = (fastPrev < slowPrev) && (fastCurrent > slowCurrent);
bool sellSignal = (fastPrev > slowPrev) && (fastCurrent < slowCurrent);

// Simple logic: if buy signal and no position, buy; if sell signal and no position, sell
if(buySignal)
{
if(!HasOpenPosition(ORDER_TYPE_BUY))
{
CloseOppositePositions(ORDER_TYPE_SELL);
OpenPosition(ORDER_TYPE_BUY);
}
}
else if(sellSignal)
{
if(!HasOpenPosition(ORDER_TYPE_SELL))
{
CloseOppositePositions(ORDER_TYPE_BUY);
OpenPosition(ORDER_TYPE_SELL);
}
}
}

// Check if there is an open position of a certain type
bool HasOpenPosition(ENUM_ORDER_TYPE orderType)
{
for(int i=0; i<PositionsTotal(); i++)
{
ulong ticket = PositionGetTicket(i);
if(PositionSelectByTicket(ticket))
{
if(PositionGetInteger(POSITION_TYPE) == orderType)
return true;
}
}
return false;
}

// Close positions opposite to the current signal
void CloseOppositePositions(ENUM_ORDER_TYPE orderTypeToClose)
{
for(int i=PositionsTotal()-1; i>=0; i--)
{
ulong ticket = PositionGetTicket(i);
if(PositionSelectByTicket(ticket))
{
if(PositionGetInteger(POSITION_TYPE) == orderTypeToClose)
ClosePosition(ticket);
}
}
}

// Open a market position (buy or sell)
void OpenPosition(ENUM_ORDER_TYPE orderType)
{
MqlTradeRequest request;
MqlTradeResult result;

request.action = TRADE_ACTION_DEAL;
request.symbol = _Symbol;
request.volume = Lots;
request.type = orderType;
request.price = SymbolInfoDouble(_Symbol, SYMBOL_ASK);
request.deviation = 10;
request.magic = 123456;

if(!OrderSend(request,result))
Print("Trade failed: ", GetLastError());
else
Print("Trade opened: ", orderType == ORDER_TYPE_BUY ? "BUY" : "SELL");
}

// Close position by ticket
void ClosePosition(ulong ticket)
{
MqlTradeRequest request;
MqlTradeResult result;

if(!PositionSelectByTicket(ticket))
{
Print("Position not found: ", ticket);
return;
}

double volume = PositionGetDouble(POSITION_VOLUME);
ENUM_POSITION_TYPE type = (ENUM_POSITION_TYPE)PositionGetInteger(POSITION_TYPE);
double price = (type == POSITION_TYPE_BUY) ? SymbolInfoDouble(_Symbol, SYMBOL_BID) : SymbolInfoDouble(_Symbol, SYMBOL_ASK);

request.action = TRADE_ACTION_DEAL;
request.position = ticket;
request.symbol = _Symbol;
request.volume = volume;
request.type = (type == POSITION_TYPE_BUY) ? ORDER_TYPE_SELL : ORDER_TYPE_BUY;
request.price = price;
request.deviation = 10;
request.magic = 123456;

if(!OrderSend(request,result))
Print("Close failed: ", GetLastError());
else
Print("Position closed: ", ticket);
}

응답함

1
개발자 1
등급
(254)
프로젝트
341
71%
중재
12
42% / 25%
기한 초과
12
4%
무료
게재됨: 17 코드
2
개발자 2
등급
(50)
프로젝트
73
21%
중재
11
18% / 27%
기한 초과
6
8%
작업중
3
개발자 3
등급
프로젝트
0
0%
중재
0
기한 초과
0
무료
4
개발자 4
등급
(5)
프로젝트
5
20%
중재
0
기한 초과
0
작업중
5
개발자 5
등급
(3)
프로젝트
3
0%
중재
0
기한 초과
0
바쁜
6
개발자 6
등급
(84)
프로젝트
115
70%
중재
5
80% / 0%
기한 초과
11
10%
무료
7
개발자 7
등급
(6)
프로젝트
6
17%
중재
2
0% / 0%
기한 초과
1
17%
로드됨
8
개발자 8
등급
프로젝트
0
0%
중재
0
기한 초과
0
무료
비슷한 주문
Hello, I would like to develop a custom Expert Advisor (EA) for MT4 (or MT5 if preferred). Requirements: Open trades based on a signal (to be specified later: e.g., indicator, moving average cross, or manual conditions). Automatically set Stop Loss (SL) and Take Profit (TP) for each trade. Option to open an averaging/hedging trade with the same lot size when the price moves against the first trade by a defined number
⸻ I have an Expert Advisor called NeuroTrendX_Pro v7.9 ULTRA (NTX Pro). I need a reliable and experienced MQL5 developer to finalize and correct it without removing or disabling any existing logic. Scope of work (included in the fixed budget): • Fix all existing compile/runtime errors (not just one). • Keep the entire current logic intact (do not remove or change modules). • Implement and confirm the following
Automate my strategy 30 - 70 USD
🚀 Looking for a Trading Bot Coder 🚀 I’m searching for an experienced developer to help automate my trading strategies. Requirements: Strong knowledge in MQL5 / MT5 (or TradingView Pine Script, depending on platform) Experience with price action & strategy automation Ability to integrate custom risk management & alerts 💡 If you’re a skilled coder who can turn trading ideas into a profitable bot, let’s connect
Hello, I’m looking for an MQL5 or MQL4 EA that trades EURUSD (optionally other majors or XAUUSD). The broker applies a 4-pip spread on EURUSD and higher on other symbols. The sole objective is to generate at least 45–60 lots of volume within 2 weeks or max one month (more is better; a bonus is paid for every additional 10 lots traded). The account has 1000 USD starting balance. Capital preservation is not required
Hey there, I’m looking to get a custom NinjaTrader indicator/plugin/tool developed. It’s very similar to Riley Coleman’s “Candlestick Trader” indicator (you can see a walkthrough of it in this YouTube video at timestamp 6:52: https://www.youtube.com/watch?v=NjCUZveXtLo&amp ;t=303s ). Please take a look at that video for reference, as I’d like most of the core features replicated. To summarize, the key functions I
I am looking for an experience MQL4 developer for making a profitable prop firm compatible MT4 gold scalper EA on a 5 Minute time frame. The EA should have a win rate of not less than 90% on back testing. The EA should be able to pass all prop firm challenges like Funded Next, FTMO, Funding Pips within 1-2 weeks. The EA should also work on live funded account. Any strategy can be used to develop the EA. Proper risk
I’m looking for a profitable Expert Advisor (EA) — the real beast that can deliver strong results on MT4/MT5. If you have a proven EA with good performance and risk management, kindly reach out with details and results
Modify my MT5 EA 30 - 40 USD
I am looking for an MQL5 programmer who can modify and customize my personal MT5 EA. There is problem in placing stop loss but still the EA is profitable on back testing. I also want to add news filter and prop firm compatible. The details will be shared to the developer personally
Hi, I am looking for readymade EA/a developer who can build it one for me. Feel free to contact me if you can fulfill my requirement. But be sure my a developer must have capability to develop complex EA with robust architecture. Especially on sophisticated trading methodology i.e. ICT/SMC etc
Please build me an EA tha can do the following: Normally I when executed buy (0.01)trade, I place sell (0.03) stop order for in case I predicted wrong, and when this sell is triggered, I place buy (0.07) stop on the initial buy, and the circle go on until I Tp is hit, all these trades I set TP and SL on them and they correspond, for sells will have same TP and Same SL, and all buys triggered after initial will have

프로젝트 정보

예산
30 - 1000 USD
기한
에서 1  7 일

고객

넣은 주문1
중재 수0