指定
//+------------------------------------------------------------------+
//| 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);
}
//| 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
等级
项目
341
71%
仲裁
12
42%
/
25%
逾期
12
4%
空闲
发布者: 17 代码
2
等级
项目
73
21%
仲裁
11
18%
/
27%
逾期
6
8%
工作中
3
等级
项目
0
0%
仲裁
0
逾期
0
空闲
4
等级
项目
5
20%
仲裁
0
逾期
0
工作中
5
等级
项目
3
0%
仲裁
0
逾期
0
繁忙
6
等级
项目
115
70%
仲裁
5
80%
/
0%
逾期
11
10%
空闲
7
等级
项目
6
17%
仲裁
2
0%
/
0%
逾期
1
17%
已载入
8
等级
项目
0
0%
仲裁
0
逾期
0
空闲
相似订单
Looking for Profitable Ready Made EA
30 - 50 USD
I need a profitable trading EA that can maximize a profitable trade for daily uses. An EA that can trade all kinds of of currencies and must be an existing EA with 70-80% guarantee
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
Create a Ninjatrader Indicator
100+ USD
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& ;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
Profitable MT4 EA suitable for prop firms
30 - 100 USD
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
Auto Follow up pending orders
30+ USD
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
Breakout and Retest/Supply and Demand Strategies for EA Expert Advisors, on MQL5 1. *Breakout Strategy*: Identify key levels of support/resistance and enter trades upon breakout. 2. *Retest Strategy*: Wait for price to retest previously broken levels before entering trades. 3. *Supply and Demand Strategy*: Identify areas of strong buying/selling interest (supply/demand zones). *Best Practices* 1. Define clear
Stratagy: breakout and retest strategy base on price action technic.on a high time frame simple plug and play expert advisors EA. Options for lots adjustment options for buy and sell only option for pending order sl/to/trailing stop
项目信息
预算
30 - 1000 USD
截止日期
从 1 到 7 天
客户
所下订单1
仲裁计数0