코딩 도움말 - 페이지 259

 

사용자 지정 차트의 틱 백 테스트를 통해 틱을 달성하려고 합니다. 경험이 없기 때문에 누군가 나에게 앞으로 나아갈 수 있도록 도움의 손길을 줄 수 있습니다. 내가 분명히 뭔가 잘못하고 있기 때문입니다.

CSV 파일에서 따옴표를 읽고 FXT 및 HST 파일에 저장합니다.

그런 다음 FXT 파일을 읽기 전용으로 표시합니다. 문제는 전략 테스터 가 내 FXT 파일을 받아들이지 않고 중지한다는 것입니다.

내가 모르는 것은 FXT 및 HST 파일이 얼마나 일관성이 있어야 하는지입니다. 내 말은 - 예를 들어 rangebars 차트에는 HST에서 1포인트의 균일한 간격이 있는 반면 FXT에서는 적당한 간격이 있습니다. 문제가 될 수 있습니까?

파일:
clipboard72.png  19 kb
 
Ovo:
사용자 지정 차트의 틱 백 테스트를 통해 틱을 달성하려고 합니다. 경험이 없기 때문에 누군가 나에게 앞으로 나아갈 수 있도록 도움의 손길을 줄 수 있습니다. 내가 분명히 뭔가 잘못하고 있기 때문입니다.

CSV 파일에서 따옴표를 읽고 FXT 및 HST 파일에 저장합니다.

그런 다음 FXT 파일을 읽기 전용으로 표시합니다. 문제는 전략 테스터가 내 FXT 파일을 받아들이지 않고 중지한다는 것입니다.

내가 모르는 것은 FXT 및 HST 파일이 얼마나 일관성이 있어야 하는지입니다. 내 말은 - 예를 들어 rangebars 차트에는 HST에서 1포인트의 균일한 간격이 있는 반면 FXT에서는 중간 간격이 있습니다. 문제가 될 수 있습니까?

오보

그것은 전혀 문제가 되지 않아야 합니다(백 테스트할 때 fxt 파일에 1포인트보다 훨씬 더 큰 간격이 생깁니다). fxt 파일의 형식이 적절합니까(신규)?

 
mladen:
Ovo 그것은 전혀 문제가 되지 않아야 합니다(백 테스트할 때 fxt 파일에 1포인트보다 훨씬 더 큰 간격이 생깁니다). fxt 파일의 형식이 적절합니까(신규)?

감사합니다. 문제가 되지 않기를 바랍니다.

FXT의 실제 형식이 무엇인지 확실하지 않지만 내가 가지고 있는 형식은 촛불을 렌더링합니다.

먼저 MQL4 사이트에서 401 버전을 찾았는데 405를 리버스 엔지니어링하는 데 도움이 되었고, 그 다음 내부에 405 버전이 포함된 CSV2FXT 스크립트를 찾았지만 아직 완전히 분석하지 못했습니다.

제 생각에는 버그가 헤더 콘텐츠에 있는 것보다 훨씬 더 많은 관심을 기울이지 않은 부분에 있다고 생각합니다.

이제 촛불 모양보다 FXT 헤더에 초점을 맞춰야 합니다(매우 적절하게 렌더링됨).

현재 FXT에 다음 구조를 사용합니다.

struct Shortdate {

int date;

};

struct Padding {

char padding;

};

struct MT4FxtCandle {

datetime openTime;

double open;

double high;

double low;

double close;

uint volume;

uint spread;

Shortdate tickTime;

int flag;

};

struct MT4FxtHeader {

int version;

char copyright[64];

char server[128];

char symbol[12];

int period;

TestModelEnum model;

int bars;

Shortdate fromdate;

Shortdate todate;

Padding p1[4];

double modelquality;

char currency[12];

int spread;

int digits;

Padding p2[4];

double point;

int lot_min;

int lot_max;

int lot_step;

int stops_level;

int gtc_pendings;

Padding p3[4];

double contract_size;

double tick_value;

double tick_size;

ProfitCalcModeEnum profit_mode;

int swap_enable;

int swap_type;

Padding p4[4];

double swap_long;

double swap_short;

int swap_rollover3days;

int leverage;

FreeMarginCalcModeEnum free_margin_mode;

MarginCalcModeEnum margin_mode;

int margin_stopout;

ENUM_ACCOUNT_STOPOUT_MODE margin_stopout_mode;

double margin_initial;

double margin_maintenance;

double margin_hedged;

double margin_divider;

char margin_currency[12];

Padding p5[4];

double comm_base;

int comm_type;

int comm_lots;

int from_bar;

int to_bar;

int start_period[6];

int from;

int to;

int freeze_level;

int reserved[61];

};

 
Ovo:
감사합니다. 문제가 되지 않기를 바랍니다.

FXT의 실제 형식이 무엇인지 확실하지 않지만 내가 가지고 있는 형식은 촛불을 렌더링합니다.

먼저 MQL4 사이트에서 401 버전을 찾았는데 405를 리버스 엔지니어링하는 데 도움이 되었고, 그 다음 내부에 405 버전이 포함된 CSV2FXT 스크립트를 찾았지만 아직 완전히 분석하지 못했습니다.

제 생각에는 버그가 헤더 콘텐츠에 있는 것보다 훨씬 더 많은 관심을 기울이지 않은 부분에 있다고 생각합니다.

이제 촛불 모양보다 FXT 헤더에 초점을 맞춰야 합니다(매우 적절하게 렌더링됨).

현재 FXT에 다음 구조를 사용합니다.

struct Shortdate {

int date;

};

struct Padding {

char padding;

};

struct MT4FxtCandle {

datetime openTime;

double open;

double high;

double low;

double close;

uint volume;

uint spread;

Shortdate tickTime;

int flag;

};

struct MT4FxtHeader {

int version;

char copyright[64];

char server[128];

char symbol[12];

int period;

TestModelEnum model;

int bars;

Shortdate fromdate;

Shortdate todate;

Padding p1[4];

double modelquality;

char currency[12];

int spread;

int digits;

Padding p2[4];

double point;

int lot_min;

int lot_max;

int lot_step;

int stops_level;

int gtc_pendings;

Padding p3[4];

double contract_size;

double tick_value;

double tick_size;

ProfitCalcModeEnum profit_mode;

int swap_enable;

int swap_type;

Padding p4[4];

double swap_long;

double swap_short;

int swap_rollover3days;

int leverage;

FreeMarginCalcModeEnum free_margin_mode;

MarginCalcModeEnum margin_mode;

int margin_stopout;

ENUM_ACCOUNT_STOPOUT_MODE margin_stopout_mode;

double margin_initial;

double margin_maintenance;

double margin_hedged;

double margin_divider;

char margin_currency[12];

Padding p5[4];

double comm_base;

int comm_type;

int comm_lots;

int from_bar;

int to_bar;

int start_period[6];

int from;

int to;

int freeze_level;

int reserved[61];

};

더 많은 정보를 찾기 위해 노력할 것입니다

hst 및 fxt 파일의 헤더에 대한 일부 세부정보는 공개하지 않았으므로 헤더 형식을 100% 정확하게 해독할 수 있는지 확신할 수 없습니다.

 

안녕하세요 저는 라운드넘버를 사용하지 않고 제 개인 스페셜넘버를 사용하고 있으며 첨부된 인디에 REPLACE 하고 싶습니다. 내 번호는 5, 15, 31, 45 및 67입니다. 귀하의 종류를 기다리면 곧 응답합니다.

파일:
 

주문수정 오류1

안녕하세요 여러분,

누군가가 나를 도울 수 있는지 궁금합니다. 컴파일 오류가 발생하지 않지만 동안

백 테스트 MT4에서 "OrderModify Error1"이 표시됩니다. 내가 뭘 더 잘할 수 있을까

아래 내 코드에서?

bool ModifyOrder(int nOrderType,int ord_ticket,double op,double price,double tp,color mColor=CLR_NONE)

{

int cnt,err;

double myStop;

myStop=ValidStopLoss(nOrderType,price);

cnt=0;

while(cnt<totalTries)

{

if(OrderModify(ord_ticket,op,myStop,tp,0,mColor))

{

return(true);

}

else

{

err=GetLastError();

if(err>1) Print(cnt," Error modifying order : (",ord_ticket,") "+ErrorDescription(err)," err ",err);

if(err>0) cnt++;

Sleep(retryDelay);

}

}

return(false);

}

[/CODE]

void OpenBuyOrder()

{

int ticket;

int err,digits;

double myStopLoss=0,myTakeProfit=0,myPrice=0;

myPrice=MarketInfo(Symbol(),MODE_ASK);

myStopLoss=0;

if(StopLoss>0) myStopLoss=myPrice-StopLoss*point;

if(myStopLoss!=0) ValidStopLoss(OP_BUY,myStopLoss);

myTakeProfit=0;

if(UseTakeProfit && TakeProfit>0) myTakeProfit=myPrice+TakeProfit*point;

// Normalize all price / stoploss / takeprofit to the proper # of digits.

digits=MarketInfo(Symbol(),MODE_DIGITS);

if(digits>0)

{

myPrice=NormalizeDouble(myPrice,digits);

myStopLoss=NormalizeDouble(myStopLoss,digits);

myTakeProfit=NormalizeDouble(myTakeProfit,digits);

}

ticket=OrderSend(Symbol(),OP_BUY,lotMM,myPrice,Slippage,myStopLoss,myTakeProfit,setup,MagicNumber,0,LimeGreen);

if(ticket>0 && ModifyOrder(OP_BUY,ticket,OrderOpenPrice(),myStopLoss,myTakeProfit,CLR_NONE))

{

if(Debug) Print("BUY order opened : ",OrderOpenPrice());

}

else

{

err=GetLastError();

Print("Error opening BUY order : ("+err+") "+ErrorDescription(err));

}

}

[/CODE]

[CODE]

void OpenSellOrder()

{

int ticket;

int err,digits;

double myStopLoss=0,myTakeProfit=0,myPrice=0;

myPrice=MarketInfo(Symbol(),MODE_BID);

myStopLoss=0;

if(StopLoss>0) myStopLoss=myPrice+StopLoss*point;

if(myStopLoss!=0) ValidStopLoss(OP_SELL,myStopLoss);

myTakeProfit=0;

if(UseTakeProfit && TakeProfit>0) myTakeProfit=myPrice-TakeProfit*point;

// Normalize all price / stoploss / takeprofit to the proper # of digits.

digits=MarketInfo(Symbol(),MODE_DIGITS);

if(digits>0)

{

myPrice=NormalizeDouble(myPrice,digits);

myStopLoss=NormalizeDouble(myStopLoss,digits);

myTakeProfit=NormalizeDouble(myTakeProfit,digits);

}

ticket=OrderSend(Symbol(),OP_SELL,lotMM,myPrice,Slippage,myStopLoss,myTakeProfit,setup,MagicNumber,0,Red);

if(ticket>0 && ModifyOrder(OP_SELL,ticket,OrderOpenPrice(),myStopLoss,myTakeProfit,CLR_NONE))

{

if(Debug) Print("SELL order opened : ",OrderOpenPrice());

}

else

{

err=GetLastError();

Print("Error opening SELL order : ("+err+") "+ErrorDescription(err));

}

return(0);

}

[CODE]

int HandleTrailingStop(int type,int ticket,double op,double os,double tp)

{

double pt,TS=0,myAsk,myBid;

switch(type)

{

case OP_BUY:

{

myBid=MarketInfo(Symbol(),MODE_BID);

switch(TrailingStopType)

{

case 1: pt=point*StopLoss;

if(myBid-os>pt)

ModifyOrder(type,ticket,op,myBid-pt,tp,Aqua);

break;

case 2: pt=point*TrailingStop;

if(myBid-op>pt && os<myBid-pt)

ModifyOrder(type,ticket,op,myBid-pt,tp,Aqua);

break;

}

return(0);

break;

}

case OP_SELL:

{

myAsk=MarketInfo(Symbol(),MODE_ASK);

switch(TrailingStopType)

{

case 1: pt=point*StopLoss;

if(os-myAsk>pt)

ModifyOrder(type,ticket,op,myAsk+pt,tp,Aqua);

break;

case 2: pt=point*TrailingStop;

if(op-myAsk>pt && os>myAsk+pt)

ModifyOrder(type,ticket,op,myAsk+pt,tp,Aqua);

break;

}

}

return(0);

}

}

미리 감사합니다!

 
tfi_markets:
주문수정 오류1

안녕하세요 여러분,

누군가 나를 도울 수 있는지 궁금합니다. 컴파일 오류가 발생하지 않지만 동안

백 테스트 MT4에서 "OrderModify Error1"이 표시됩니다. 내가 뭘 더 잘할 수 있을까

아래 내 코드에서?

bool ModifyOrder(int nOrderType,int ord_ticket,double op,double price,double tp,color mColor=CLR_NONE)

{

int cnt,err;

double myStop;

myStop=ValidStopLoss(nOrderType,price);

cnt=0;

while(cnt<totalTries)

{

if(OrderModify(ord_ticket,op,myStop,tp,0,mColor))

{

return(true);

}

else

{

err=GetLastError();

if(err>1) Print(cnt," Error modifying order : (",ord_ticket,") "+ErrorDescription(err)," err ",err);

if(err>0) cnt++;

Sleep(retryDelay);

}

}

return(false);

}

[/CODE]

void OpenBuyOrder()

{

int ticket;

int err,digits;

double myStopLoss=0,myTakeProfit=0,myPrice=0;

myPrice=MarketInfo(Symbol(),MODE_ASK);

myStopLoss=0;

if(StopLoss>0) myStopLoss=myPrice-StopLoss*point;

if(myStopLoss!=0) ValidStopLoss(OP_BUY,myStopLoss);

myTakeProfit=0;

if(UseTakeProfit && TakeProfit>0) myTakeProfit=myPrice+TakeProfit*point;

// Normalize all price / stoploss / takeprofit to the proper # of digits.

digits=MarketInfo(Symbol(),MODE_DIGITS);

if(digits>0)

{

myPrice=NormalizeDouble(myPrice,digits);

myStopLoss=NormalizeDouble(myStopLoss,digits);

myTakeProfit=NormalizeDouble(myTakeProfit,digits);

}

ticket=OrderSend(Symbol(),OP_BUY,lotMM,myPrice,Slippage,myStopLoss,myTakeProfit,setup,MagicNumber,0,LimeGreen);

if(ticket>0 && ModifyOrder(OP_BUY,ticket,OrderOpenPrice(),myStopLoss,myTakeProfit,CLR_NONE))

{

if(Debug) Print("BUY order opened : ",OrderOpenPrice());

}

else

{

err=GetLastError();

Print("Error opening BUY order : ("+err+") "+ErrorDescription(err));

}

}

[/CODE]

[CODE]

void OpenSellOrder()

{

int ticket;

int err,digits;

double myStopLoss=0,myTakeProfit=0,myPrice=0;

myPrice=MarketInfo(Symbol(),MODE_BID);

myStopLoss=0;

if(StopLoss>0) myStopLoss=myPrice+StopLoss*point;

if(myStopLoss!=0) ValidStopLoss(OP_SELL,myStopLoss);

myTakeProfit=0;

if(UseTakeProfit && TakeProfit>0) myTakeProfit=myPrice-TakeProfit*point;

// Normalize all price / stoploss / takeprofit to the proper # of digits.

digits=MarketInfo(Symbol(),MODE_DIGITS);

if(digits>0)

{

myPrice=NormalizeDouble(myPrice,digits);

myStopLoss=NormalizeDouble(myStopLoss,digits);

myTakeProfit=NormalizeDouble(myTakeProfit,digits);

}

ticket=OrderSend(Symbol(),OP_SELL,lotMM,myPrice,Slippage,myStopLoss,myTakeProfit,setup,MagicNumber,0,Red);

if(ticket>0 && ModifyOrder(OP_SELL,ticket,OrderOpenPrice(),myStopLoss,myTakeProfit,CLR_NONE))

{

if(Debug) Print("SELL order opened : ",OrderOpenPrice());

}

else

{

err=GetLastError();

Print("Error opening SELL order : ("+err+") "+ErrorDescription(err));

}

return(0);

}

[CODE]

int HandleTrailingStop(int type,int ticket,double op,double os,double tp)

{

double pt,TS=0,myAsk,myBid;

switch(type)

{

case OP_BUY:

{

myBid=MarketInfo(Symbol(),MODE_BID);

switch(TrailingStopType)

{

case 1: pt=point*StopLoss;

if(myBid-os>pt)

ModifyOrder(type,ticket,op,myBid-pt,tp,Aqua);

break;

case 2: pt=point*TrailingStop;

if(myBid-op>pt && os<myBid-pt)

ModifyOrder(type,ticket,op,myBid-pt,tp,Aqua);

break;

}

return(0);

break;

}

case OP_SELL:

{

myAsk=MarketInfo(Symbol(),MODE_ASK);

switch(TrailingStopType)

{

case 1: pt=point*StopLoss;

if(os-myAsk>pt)

ModifyOrder(type,ticket,op,myAsk+pt,tp,Aqua);

break;

case 2: pt=point*TrailingStop;

if(op-myAsk>pt && os>myAsk+pt)

ModifyOrder(type,ticket,op,myAsk+pt,tp,Aqua);

break;

}

}

return(0);

}

}

미리 감사합니다!

tfi_markets

오류 1은 오류가 아니며, 단순히 수행하려는 수정으로 인해 주문이 수정되지 않는다는 의미입니다(주문은 동일하게 유지됨). 그대로 두거나 의도한 변경된 부분이 할당하려는 값과 다른지 간단히 확인할 수 있습니다.

 

안녕하세요, renko chart tf를 시작한 이후의 일수를 알아보는 데 도움이 필요합니다.

도움에 감사드립니다

 
lambic:
안녕하세요, renko chart tf를 시작한 이후의 일수를 알아보는 데 도움이 필요합니다. 도움에 감사드립니다

renko의 첫 번째(가장 오래된) 바 이후를 의미한다면 다음을 수행하십시오.

int numOfDays = (시간[0]-시간)/(1440*60);

 
mladen:
renko의 첫 번째(가장 오래된) 막대 이후를 의미한다면 다음을 수행하십시오. int numOfDays = (Time[0]-Time)/(1440*60);

너무 간단합니다! 배열 함수 를 찾고 있었는데 그것은 단순히 Time[]이었습니다. 죄송합니다 바보입니다. 정말 감사합니다 !