[경고, 주제 닫힘!] 포럼을 어지럽히지 않도록 모든 초보자 질문. 프로, 놓치지 마세요. 당신 없이는 어디에도 없습니다. - 페이지 697

 
rensbit :
앵커 각도 - 창에서 개체의 위치가 계산되는 각도입니다. 각도는 왼쪽에서 오른쪽으로 시계 방향으로 계산됩니다.

오른쪽 하단 모서리에 스냅하면 음수 좌표를 설정합니까?
 
valenok2003 :

오른쪽 하단 모서리에 스냅하면 음수 좌표를 설정합니까?
아니요, 양수 좌표, 터미널은 원하는 지점 자체를 계산합니다. 예: 2개의 모서리에서 15픽셀
 
Azerus :

말하다,

연속 이벤트의 수(예: 종가가 시가보다 높고 그 반대인 시리즈의 막대 수)를 계산하기 위해 다음과 같은 생각밖에 할 수 없었습니다.

두 가지 질문(위의 내용이 의미가 있는 경우): (1) 연속 시리즈가 중지된 경우 카운터를 재설정하는 방법; 및 (2) Buffer[i]를 올바르게 작성하는 방법 - 즉. 결과 자체를 어떻게 "볼" 수 있습니까?

즉, 특정 막대에 대한 표시기가 "-3"으로 표시되면 이것이 열림 아래에서 닫힌 행의 세 번째 막대임을 의미합니다. 그 뒤에 오는 막대가 열린 곳 위에서 닫히면 표시기에 "1"이 표시됩니다........

int i=바-1

동안 (i > 0) {

정수 = 0;

정수 y=0;

if ( 닫기[i] > 열기[i] ) { x++ ;

버퍼[i]=x; }

if (닫기[i] < 열기[i] ) { y-- ;

버퍼2[i]=y; }

나--;

}

 
rensbit :
아니요, 양수 좌표, 터미널은 원하는 지점 자체를 계산합니다. 예: 2개의 모서리에서 15픽셀
감사합니다. 모두 잘 작동했습니다.
 
artmedia70 :
추측할 필요가 없도록 코드를 보여주세요.


귀하의 마틴을 추가하여 Gorando 프로그램에서 제작되었습니다.

//+----------------------------------------------- --------------------+
//| Copyright 2005 Gordago Software Corp. |
//| http://www.gordago.com/ |
//| 버전 2.0 |
//+----------------------------------------------- --------------------+

#property copyright "Copyright 2005, Gordago Software Corp."
#속성 링크 "http://www.gordago.com"

#define MIN_STOPLOSS_POINT 10
#define MIN_TAKEPROFIT_POINT 10
#define MAGIC 218650

extern string sNameExpert = "Gordago에서 생성";
외부 정수 n계정 = 0;
외부 이중 dBuyStopLossPoint = 0;
외부 이중 dSellStopLossPoint = 0;
외부 이중 dBuyTakeProfitPoint = 0;
외부 이중 dSellTakeProfitPoint = 0;
외부 이중 dBuyTrailingStopPoint = 0;
외부 이중 dSellTrailingStopPoint = 0;
외부 이중 로트 = 0.10;
extern int nSlippage = 30;
extern bool lFlagUseHourTrade = True;
외부 정수 nFromHourTrade = 0;
외부 int nToHourTrade = 23;
extern bool lFlagUseSound = False;
외부 문자열 sSoundFileName = "alert.wav";
외부 색상 colorOpenBuy = 파란색;
extern color colorCloseBuy = 아쿠아;
외부 색상 colorOpenSell = 빨간색;
외부 색상 colorCloseSell = 아쿠아;


무효 deinit() {
논평("");
}

//+----------------------------------------------- --------------------+
//| |
//+----------------------------------------------- --------------------+
정수 시작(){
if (lFlagUseHourTrade){
if (!(Hour()>=nFromHourTrade && Hour()<=nToHourTrade)) {
Comment("거래의 시간이 오지 않았습니다!");
리턴(0);
}
}

if(막대 < 100){
Print("100개 미만의 막대");
리턴(0);
}

if (nAccount > 0 && nAccount != AccountNumber()){
Comment("계정 거래 :"+AccountNumber()+" 금지!");
리턴(0);
}

if((dBuyStopLossPoint > 0 && dBuyStopLossPoint < MIN_STOPLOSS_POINT) ||
(dSellStopLossPoint > 0 && dSellStopLossPoint < MIN_STOPLOSS_POINT)){
Print("StopLoss가 " + MIN_STOPLOSS_POINT보다 작음);
리턴(0);
}
if((dBuyTakeProfitPoint > 0 && dBuyTakeProfitPoint < MIN_TAKEPROFIT_POINT) ||
(dSellTakeProfitPoint > 0 && dSellTakeProfitPoint < MIN_TAKEPROFIT_POINT)){
Print("TakeProfit이 " + MIN_TAKEPROFIT_POINT보다 작음);
리턴(0);
}

이중 diOpen0=iOpen(NULL,60,0);
이중 d1=(0.00030);
이중 diHigh2=iHigh(NULL,60,0);
이중 diOpen3=iOpen(NULL,60,0);
이중 d4=(0.00030);
이중 diLow5=iLow(NULL,60,0);
이중 diOpen6=iOpen(NULL,60,1);
이중 diClose7=iClose(NULL,60,1);
이중 diOpen8=iOpen(NULL,60,2);
이중 diClose9=iClose(NULL,60,2);
이중 diOpen10=iOpen(NULL,60,0);
이중 d11=(0.00030);
이중 diHigh12=iHigh(NULL,60,0);
이중 diOpen13=iOpen(NULL,60,0);
이중 d14=(0.00030);
이중 diLow15=iLow(NULL,60,0);
이중 diOpen16=iOpen(NULL,60,1);
이중 diClose17=iClose(NULL,60,1);
이중 diOpen18=iOpen(NULL,60,2);
이중 diClose19=iClose(NULL,60,2);


if(AccountFreeMargin() < (1000*Lot)){
Print("돈이 없습니다. Free Margin = " + AccountFreeMargin());
리턴(0);
}

부울 lFlagBuyOpen = 거짓, lFlagSellOpen = 거짓, lFlagBuyClose = 거짓, lFlagSellClose = 거짓;

lFlagBuyOpen = (diOpen0+d1>diHigh2 && diOpen3-d4<diLow5 && diOpen6<diClose7 && diOpen8>diClose9);
lFlagSellOpen = (diOpen10+d11>diHigh12 && diOpen13-d14<diLow15 && diOpen16>diClose17 && diOpen18<diClose19);
lFlagBuyClose = 거짓;
lFlagSellClose = 거짓;

if (!ExistPositions()){

if (lFlagBuyOpen){
오픈바이();
리턴(0);
}

if (lFlagSellOpen){
오픈셀();
리턴(0);
}
}
if (ExistPositions()){
if(주문유형()==OP_BUY){
if (lFlagBuyClose){
bool flagCloseBuy = OrderClose(OrderTicket(), OrderLots(), 입찰, nSlippage, colorCloseBuy);
if (flagCloseBuy && lFlagUseSound)
플레이사운드(사운드파일명);
리턴(0);
}
}
if(주문유형()==OP_SELL){
if (lFlagSellClose){
bool flagCloseSell = OrderClose(OrderTicket(), OrderLots(), Ask, nSlippage, colorCloseSell);
if (flagCloseSell && lFlagUseSound)
플레이사운드(사운드파일명);
리턴(0);
}
}
}

if (dBuyTrailingStopPoint > 0 || dSellTrailingStopPoint > 0){

for (int i=0; i<OrdersTotal(); i++) {
if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) {
bool lMagic = true;
if (MAGIC > 0 && OrderMagicNumber() != MAGIC)
lmagic=거짓;

if (OrderSymbol()==Symbol() && lMagic) {
if (OrderType()==OP_BUY && dBuyTrailingStopPoint > 0) {
if (Bid-OrderOpenPrice() > dBuyTrailingStopPoint*Point) {
if (OrderStopLoss()<Bid-dBuyTrailingStopPoint*Point)
ModifyStopLoss(Bid-dBuyTrailingStopPoint*Point);
}
}
(주문 유형()==OP_SELL) {
if (OrderOpenPrice()-Ask>dSellTrailingStopPoint*Point) {
if (OrderStopLoss()>Ask+dSellTrailingStopPoint*Point || OrderStopLoss()==0)
ModifyStopLoss(Ask+dSellTrailingStopPoint*Point);
}
}
}
}
}
}
리턴(0);
}

부울 ExistPositions() {
for (int i=0; i<OrdersTotal(); i++) {
if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) {
bool lMagic = true;

if (MAGIC > 0 && OrderMagicNumber() != MAGIC)
lmagic=거짓;

if (OrderSymbol()==Symbol() && lMagic) {
반환(참);
}
}
}
반환(거짓);
}

무효 ModifyStopLoss(이중 ldStopLoss) {
bool lFlagModify = OrderModify(OrderTicket(), OrderOpenPrice(), ldStopLoss, OrderTakeProfit(), 0, CLR_NONE);
if (lFlagModify && lFlagUseSound)
플레이사운드(사운드파일명);
}

//+----------------------------------------------- ------------------------------+
//| 저자 : Kim Igor V. aka KimIV, http://www.kimiv.ru |
//+----------------------------------------------- ------------------------------+
//| 버전 : 2008년 2월 19일 |
//| 설명 : 마지막 위치 손실 플래그를 반환합니다. |
//+----------------------------------------------- ------------------------------+
//| 옵션: |
//| sy - 기기 이름("" - 모든 기호, |
//| NULL - 현재 문자) |
//| 연산 - 연산(-1 - 임의의 위치) |
//| mn - MagicNumber(-1 - 모든 마법) |
//+----------------------------------------------- ------------------------------+
부울 isLossLastPos(문자열 sy="", int op=-1, int mn=-1) {
날짜 시간 t;
정수 i, j=-1, k=OrdersHistoryTotal();

if (sy=="0") sy=Symbol();
(i=0; i<k; i++) {
if (OrderSelect(i, SELECT_BY_POS, MODE_HISTORY)) {
if (OrderSymbol()==sy || sy=="") {
if (OrderType()==OP_BUY || OrderType()==OP_SELL) {
if (op<0 || OrderType()==op) {
if (mn<0 || OrderMagicNumber()==mn) {
if (t<OrderCloseTime()) {
t=주문닫기시간();
j=나;
}
}
}
}
}
}
}
if (OrderSelect(j, SELECT_BY_POS, MODE_HISTORY)) {
if (OrderProfit()<0) return(True);
}
반환(거짓);
}





무효 OpenBuy() {
이중 dStopLoss = 0, dTakeProfit = 0;
이중 lot_New = 제비;

if (isLossLastPos(NULL, -1, MAGIC))
많은_신규 *= 2;
else if (!isLossLastPos(NULL, -1, MAGIC))
제비_신규 = 제비;


if (dBuyStopLossPoint > 0)
dStopLoss = Bid-dBuyStopLossPoint*포인트;

if (dBuyTakeProfitPoint > 0)
dTakeProfit = 입찰가 + dBuyTakeProfitPoint * 포인트;

int numorder = OrderSend(Symbol(), OP_BUY, lot_New, Ask, nSlippage, dStopLoss, dTakeProfit, sNameExpert, MAGIC, 0, colorOpenBuy);

if (번호 > -1 && lFlagUseSound)
플레이사운드(사운드파일명);
}

무효 OpenSell() {
이중 dStopLoss = 0, dTakeProfit = 0;
이중 lot_New = 제비;

if (isLossLastPos(NULL, -1, MAGIC))
많은_신규 *= 2;
else if (!isLossLastPos(NULL, -1, MAGIC))
제비_신규 = 제비;

if (dSellStopLossPoint > 0)
dStopLoss = Ask+dSellStopLossPoint*포인트;

if (dSellTakeProfitPoint > 0)
dTakeProfit = Ask-dSellTakeProfitPoint*포인트;

int numorder = OrderSend(Symbol(), OP_SELL, lot_New, Bid, nSlippage, dStopLoss, dTakeProfit, sNameExpert, MAGIC, 0, colorOpenSell);

if (번호 > -1 && lFlagUseSound)
플레이사운드(사운드파일명);
}

 
valenok2003 :

예시에서 어렵지 않다면 필요에 따라 수정하세요.
      ObjectSetText( "info" , str3, fontsize, fontname);
      ObjectSet( "info" , OBJPROP_CORNER , corner);
      ObjectSet( "info" , OBJPROP_XDISTANCE , xdistance);
      ObjectSet( "info" , OBJPROP_YDISTANCE , ydistance);
      ObjectSet( "info" , OBJPROP_COLOR , clr);

(편의상) 모서리 변수를 외부로 만들었습니다. 좌표를 계산할 각도의 숫자를 포함합니다.

 
Roger :


교체 시도

if (OrderStopLoss()<pp-(TStop.Buy+TrailingStep-1)*po||OrderStopLoss()==0)

if (OrderStopLoss()>pp-(TStop.Buy+TrailingStep-1)*po||OrderStopLoss()==0)

로저, 고맙지만 여전히 제대로 작동하지 않습니다. 다른 트레일을 고정하려고했지만 오류가 여전히 남아 있습니다.
 
rensbit :

(편의상) 모서리 변수를 외부로 만들었습니다. 좌표를 계산할 각도의 숫자를 포함합니다.

고맙습니다!

질문 하나 더. Wingdings의 기호를 주석에 올바르게 삽입하는 방법.

 
무슨 상징?
 
rensbit :
무슨 상징?

저작권