int y; int totalOrders = 4; datetime toT; // Time of Trade datetime doT; // Day of Trade datetime now = TimeCurrent (); datetime boD=now-now% 86400 ; // Beginning of day
for (y= 0 ;y<totalOrders; y++) {
if ( OrderSelect (y, SELECT_BY_POS , MODE_HISTORY )) { toT= OrderOpenTime (); // Time of Trade doT=toT-toT% 86400 ; // Day of Trade. if (doT==boD) { // Time of Trade within Current Day.
for (j= OrdersTotal ()- 1 ;j>= 0 ; j--) { if ( OrderType ()== OP_BUY ) totalOrders++; // Check # of long trades. if ( OrderType ()== OP_SELL ) totalOrders++; // Check # of short trades }
} } }
if (totalOrders<MaxLongTrades && Indicator_LONG_signal) Order=SIGNAL_BUY; if (totalOrders<MaxShortTrades && Indicator_SHORT_signal) Order=SIGNAL_SELL;
안녕 Mladen, 나는 당신의
stepma_pdf_4_4.ex4 뿐만 아니라 히스토그램,
MT4에 복사했습니다. 차트 창으로 드래그
다음 메시지가 표시됩니다. pls는 이미지에서 볼 수 있습니다.
지표를 어떻게 사용할 수 있는지 알려주시겠습니까?
넓은 땅
추신. 평균 ___mtf__alerts_7_4.ex4 및 히스토그램에서도 동일한 일이 발생했습니다.
다음을 사용하십시오.
다음을 사용하십시오.
다시 감사합니다!! , 여유가 있을 때 ... 생선을 좋아하기를 바랍니다.
넓은 땅
다시 감사합니다!! , 여유가 있을 때 ... 생선을 좋아하기를 바랍니다.
넓은 땅
안녕하세요 mladen 씨:
업데이트해주세요
관심
안녕하세요 mladen 씨:
업데이트해주세요
관심
지금 시도하십시오.
지금 시도하십시오.
물고기 중 어느 것이 주변에 누워 있습니까?
동시에 1개의 주문(같은 마법, 기호)만 열렸습니까?
그렇다면 작동합니다.
안녕 믈라덴
조언 감사합니다. 예, EA는 한 포지션만 거래할 것입니다.
코드를 구현하고 몇 가지 테스트를 실행할 것입니다.
좋은 한 주 되세요.
안녕---
코드(지시자 또는 스크립트 ) 를 만들 수 있습니까? mt4 휴일을 축의 시간에 빈 촛불로 만들 수 있습니까?
모두에게 행운을 빕니다
친애하는 프로코더 여러분,
내 EA에 "하루에 4번의 거래" 기능을 구현하고 싶습니다. 최대 거래 한도인 경우
EA는 거래를 계속하려면 다음날까지 기다려야 합니다.
누군가 내 코드를 검토할 수 있는지 궁금합니다. 여기에 약간의 "두뇌 동결"이 있습니다... ;-)
미리 감사합니다!
extern int MaxLongTrades = 2 ;
// Count Trades per Day.
int y;
int totalOrders = 4;
datetime toT; // Time of Trade
datetime doT; // Day of Trade
datetime now = TimeCurrent ();
datetime boD=now-now% 86400 ; // Beginning of day
for (y= 0 ;y<totalOrders; y++)
{
if ( OrderSelect (y, SELECT_BY_POS , MODE_HISTORY ))
{
toT= OrderOpenTime (); // Time of Trade
doT=toT-toT% 86400 ; // Day of Trade.
if (doT==boD)
{ // Time of Trade within Current Day.
for (j= OrdersTotal ()- 1 ;j>= 0 ; j--)
{
if ( OrderType ()== OP_BUY ) totalOrders++; // Check # of long trades.
if ( OrderType ()== OP_SELL ) totalOrders++; // Check # of short trades
}
}
}
}
if (totalOrders<MaxLongTrades && Indicator_LONG_signal) Order=SIGNAL_BUY;
if (totalOrders<MaxShortTrades && Indicator_SHORT_signal) Order=SIGNAL_SELL;
내역(현재 날짜에 마감된 주문)과 열린 주문을 모두 확인하려면 다음과 같이 시도하십시오.
int totalOrdersLong = 0 , totalOrdersShort = 0 ;
for ( int y= OrdersHistoryTotal ()- 1 ;y>= 0 ; y--)
{
if ( OrderSelect (y, SELECT_BY_POS , MODE_HISTORY ))
if ( OrderCloseTime ()>=today)
{
if ( OrderType ()== OP_BUY ) totalOrdersLong++;
if ( OrderType ()== OP_SELL ) totalOrdersShort++;
}
}
for ( int y= OrdersTotal ()- 1 ;y>= 0 ; y--)
{
if ( OrderSelect (y, SELECT_BY_POS , MODE_TRADES ))
if ( OrderOpenTime ()>=today)
{
if ( OrderType ()== OP_BUY ) totalOrdersLong++;
if ( OrderType ()== OP_SELL ) totalOrdersShort++;
}
}
if (totalOrdersLong <MaxLongTrades && Indicator_LONG_signal) Order=SIGNAL_BUY;
if (totalOrdersShort<MaxShortTrades && Indicator_SHORT_signal) Order=SIGNAL_SELL;