字符串 Info() { int i; double buff_1 = 0, buff_2 = 0, buff_3 = 0。 string res = "\n";
for( i = OrdersHistoryTotal() - 1; i >= 0; i-- ) { OrderSelect(i,SELECT_BY_POS,MODE_HISTORY)。 如果( OrderMagicNumber() == ID ) { if ( OrderOpenTime() >= iTime(NULL,PERIOD_D1,0) )buff_1 += OrderProfit()。 if ( OrderOpenTime() >= iTime(NULL,PERIOD_D1,1) && OrderOpenTime() < iTime(NULL,PERIOD_D1,0) ) buff_2 += OrderProfit()。 if ( OrderOpenTime() >= GlobalVariableGet(GLOB_START) )buff_3 += OrderProfit()。 } }
res = res + "以存款货币计算的利润" + TimeToStr(iTime(NULL,PERIOD_D1,0)) + ": " + DoubleToStr(buff_1,0) + "\n" + "\n"。 res = res + "Profit in deposit currency for " + TimeToStr(iTime(NULL,PERIOD_D1,1)) + ": " + DoubleToStr(buff_2,0) + "n" + "n" 。 res = res + "存款货币的利润总额:" + DoubleToStr(buff_3,0) + "n"。 return(res)。 }
void modify_orders ( int type ) { int i; datetime time_last = 0, time_first = TimeCurrent(); double SPREAD = MarketInfo(Symbol(),MODE_SPREAD)*MarketInfo(Symbol(),MODE_POINT), op_pr_last, op_pr_first, level;
大家好。先生们,我有个问题,请指教一下,如果我用Alpari和Master_Forex工作,我在我的工作终端下载的故事上测试一个专家顾问,没有来自外部的东西,没有左边的故事,像来自Dukas,没有像Tick Data Suite这样的辅助程序,只是从我的DS终端专门为Alpari或Master_Forex建模,方法........,我在不同条件和参数上测试半年,选择最佳,然后回测和下半年,所以2-5年,然后一切在堆积,猫头鹰已经准备就绪。这能成为一个可靠的预备者吗?还是仍然需要99%和所有附加的东西。
我在论坛上发现,这是有可能的:https://www.mql5.com/ru/forum/141467
还有,我在哪里可以找到一个蜱虫模拟器?
因此,在周末用MQL4不可能实现嘀嗒声模拟吗?
就在那一页上,你在你的帖子中发布的链接。在那里更仔细地阅读它。
是的,我很愚蠢。我只需要start();另外通过init(){}启动。
int init(){start();}
...
空白启动(){...}。
谢谢,我想明白了。
我如何将我的红利兑换成钱?
谁的奖金?
我有以下代码。
外部数据时间 start = D'2013.10.17 23:59';
int start()
{
int b1=iBarShift(Symbol(),0,start,0)。
double hb=iHigh(Symbol(),0,b1); //bar
double hb2=iHigh(Symbol(),0,b1-1); //从指定日期开始的明天的条形图
请告诉我如何从指定的日期中放入昨天的日子,因为 double hb3=iHigh(Symbol(),0,b1+1); 不起作用...
大家好!!!。我有一个针对运动的EA开单,如何改变或建议在哪里改变?
string GLOB_START;
int init()
{
GLOB_START = "@" + DoubleToStr(ID,0) + "@" + "_start" 。
if !GlobalVariableCheck( GLOB_START )GlobalVariableSet( GLOB_START,TimeCurrent())。
return(0);
}
int deinit()
{
switch( UninitializeReason() )
{
caseREASON_REMOVE: delete_glob ( "@" + DoubleToStr(ID,0) + "@" ) 。
}
if ( IsTesting() )delete_glob ( "@" + DoubleToStr(ID,0) + "@" )。
return(0);
}
void delete_glob ( string c )
{
int i;
for ( i = GlobalVariablesTotal()-1; i>= 0; i-- )if ( StringFind(GlobalVariableName(i),c) >= 0 ) GlobalVariableDel(GlobalVariableName(i))
}
int start()
{
评论(Info())。
int KOL_BUY = order_total(0);
int KOL_SELL = order_total(1);
双L。
if ( order_total() == 0 )
{
open(0,Lot,0,TP)。
open(1,Lot,0,TP)。
}
如果 ( KOL_BUY == 0 && KOL_SELL != 0 )
{
open(0,Lot,0,TP)。
l = last_trade(1);
open(1,l,0,0);
modify_orders(1);
}
如果 ( KOL_BUY != 0 && KOL_SELL == 0 )
{
open(1,Lot,0,TP)。
l = last_trade(0);
open(0,l,0,0)。
modify_orders(0);
}
return(0);
}
字符串 Info()
{
int i;
double buff_1 = 0, buff_2 = 0, buff_3 = 0。
string res = "\n";
for( i = OrdersHistoryTotal() - 1; i >= 0; i-- )
{
OrderSelect(i,SELECT_BY_POS,MODE_HISTORY)。
如果( OrderMagicNumber() == ID )
{
if ( OrderOpenTime() >= iTime(NULL,PERIOD_D1,0) )buff_1 += OrderProfit()。
if ( OrderOpenTime() >= iTime(NULL,PERIOD_D1,1) && OrderOpenTime() < iTime(NULL,PERIOD_D1,0) ) buff_2 += OrderProfit()。
if ( OrderOpenTime() >= GlobalVariableGet(GLOB_START) )buff_3 += OrderProfit()。
}
}
res = res + "以存款货币计算的利润" + TimeToStr(iTime(NULL,PERIOD_D1,0)) + ": " + DoubleToStr(buff_1,0) + "\n" + "\n"。
res = res + "Profit in deposit currency for " + TimeToStr(iTime(NULL,PERIOD_D1,1)) + ": " + DoubleToStr(buff_2,0) + "n" + "n" 。
res = res + "存款货币的利润总额:" + DoubleToStr(buff_3,0) + "n"。
return(res)。
}
void modify_orders ( int type )
{
int i;
datetime time_last = 0, time_first = TimeCurrent();
double SPREAD = MarketInfo(Symbol(),MODE_SPREAD)*MarketInfo(Symbol(),MODE_POINT), op_pr_last, op_pr_first, level;
for( i = OrdersTotal() - 1; i >= 0; i-- )
{
OrderSelect(i,SELECT_BY_POS,MODE_TRADES)。
如果( OrderMagicNumber() == ID && OrderType() == type )
{
如果 ( OrderOpenTime() > time_last )
{
op_pr_last = OrderOpenPrice()。
time_last = OrderOpenTime()。
}
如果 ( OrderOpenTime() < time_first )
{
op_pr_first = OrderOpenPrice()。
time_first = OrderOpenTime()。
}
}
}
if ( type == 0 )level = op_pr_last + MathAbs(op_pr_last-op_pr_first) * (SL/100);
if ( type == 1 )level = op_pr_last - MathAbs(op_pr_last-op_pr_first) * (SL/100);
for( i = OrdersTotal() - 1; i >= 0; i -- )
{
OrderSelect(i,SELECT_BY_POS,MODE_TRADES)。
if( OrderMagicNumber() == ID && OrderType() == type && NormalizeDouble(OrderTakeProfit(),Digits) != NormalizeDouble(level,Digits) )OrderModify(OrderTicket(),OrderOpenPrice(), OrderStopLoss(),level,0)
}
}
double last_trade( int t )
{
int i;
double res = -1;
datetime time=0。
for(i=OrdersTotal()-1;i>=0;i--)
{
OrderSelect(i,SELECT_BY_POS,MODE_TRADES)。
如果(OrderOpenTime()>time && OrderMagicNumber()==ID && OrderType() ==t)
{
res = OrderLots()。
time = OrderOpenTime()。
}
}
if ( multiplier ) return(res * Lot_koeff);
if ( !multiplier )return(res + Lot_koeff);
}
int open(int type, double l, double sl=0, double tp=0, string comm = "" )
{
int isOpened = 0, try = 0;
双重的S,T。
while ( IsTradeContextBusy() ){Sleep(500);}.
RefreshRates()。
if ( sl != 0 && sl < MarketInfo(Symbol(),MODE_STOPLEVEL) )sl = MarketInfo(Symbol(),MODE_STOPLEVEL) 。
if ( tp != 0 && tp < MarketInfo(Symbol(),MODE_STOPLEVEL) )tp = MarketInfo(Symbol(),MODE_STOPLEVEL) 。
if ( type == 0 )
{
如果( tp == 0 )t = 0。
if ( tp != 0 )t = Ask + tp * Point;
如果( sl == 0 )s = 0。
if ( sl != 0 ) s = Bid - sl * Point;
}
if ( type == 1 )
{
如果( tp == 0 )t = 0。
if ( tp != 0 )t = Bid - tp * Point;
如果( sl == 0 )s = 0。
if ( sl != 0 )s = Ask + sl * Point;
}
s = NormalizeDouble(s,Digits);
t = NormalizeDouble(t,Digits)。
如果(type==0)isOpened = OrderSend(Symbol(),type,check_lot(l),NormalizeDouble(Ask,Digits),10,s,t,comm,ID)。
如果(type==1)isOpened = OrderSend(Symbol(),type,check_lot(l),NormalizeDouble(Bid,Digits),10,s,t,comm,ID)。
睡眠(500)。
while(isOpened<0)
{
while ( IsTradeContextBusy() ){Sleep(500);}.
RefreshRates()。
if ( type == 0 )
{
如果( tp == 0 )t = 0。
if ( tp != 0 )t = Bid + tp * Point;
如果( sl == 0 )s = 0。
if ( sl != 0 ) s = Bid - sl * Point;
}
if ( type == 1 )
{
如果( tp == 0 )t = 0。
if ( tp != 0 )t = Ask - tp * Point;
如果( sl == 0 )s = 0。
if ( sl != 0 )s = Ask + sl * Point;
}
s = NormalizeDouble(s,Digits);
t = NormalizeDouble(t,Digits)。
try++。
如果(type==0)isOpened = OrderSend(Symbol(),type,check_lot(l),NormalizeDouble(Ask,Digits),10,s,t,comm,ID)。
如果(type==1)isOpened = OrderSend(Symbol(),type,check_lot(l),NormalizeDouble(Bid,Digits),10,s,t,comm,ID)。
if(try > 5) break;
if(isOpened>=0)break;
睡眠(500)。
}
if(isOpened<0) Alert("Order not opened, error :", GetLastError())。
return(isOpened)。
}
int order_total ( int type_1 = -1, int type_2 = -1 )
{
int i;
int kol=0。
for(i=OrdersTotal()-1;i>=0;i--)
{
OrderSelect(i,SELECT_BY_POS,MODE_TRADES)。
如果(OrderMagicNumber()==ID && (OrderType() == type_1 || OrderType() == type_2))kol++。
if(OrderMagicNumber()==ID && type_1 ==-1 && type_2 ==-1 )kol++;
}
返回(kol)。
}
double check_lot(double &lo)
{
double l = MarketInfo(Symbol(),MODE_LOTSTEP);
int ok = 0。
while ( l < 1 ){l*=10;ok++; }
if( lo < MarketInfo(Symbol(),MODE_MINLOT) )lo = MarketInfo(Symbol(),MODE_MINLOT) 。
if( lo > MarketInfo(Symbol(),MODE_MAXLOT) )lo = MarketInfo(Symbol(),MODE_MAXLOT) 。
返回(NormalizeDouble(lo,ok))。
我如何对 "资金:"(AccountEquity())进行检索?
参数
外来的双倍TrailingStart = 10000; // Trailing level
外来的双倍TrailingStop = 100; // 尾随大小。
外来的双倍TrailingStep = 10; // Trailing步长
如何在一排中找到两个顶/底分形?下面的图片。
我想写一个指标,但我没有想清楚。
也许有人已经看到这样的指标准备好了?