·Î±×ÀÎ
|
ȸ¿ø°¡ÀÔ
|
ȸ»ç¼Ò°³
|
»çÀÌÆ®¸Ê
Ä¿¹Â´ÏƼ | ¼ö½ÄÀÛ¼º Q&A
ÀÛ¼ºÀÚ :
¿ìÀ¯
ÀÛ¼ºÀÏ : 2025-06-11 ¿ÀÈÄ 3:27:39 Á¶È¸¼ö : 22
¸¶Áö¸· Èñ¸Á
¾È³çÇϼ¼¿ä ¿À·ù ¼öÁ¤ ºÎʵå·Á¿ä
Á˼ÛÇÕ´Ï´Ù Áú¹® ¸¹¾Æ¼ ¤Ð¤Ð
1, Àü·«
// ÇöÀç°¡ ±âÁØ ÁöÁ¤°¡ ¸Å¼ö/¸Åµµ, ¼ÕÀý/ÀÍÀý, 1ȸ¸¸ ¼öÇà
// Àü¿ª º¯¼ö ¼±¾ð
vars:
longEntered(false),
shortEntered(false),
longStopHit(false),
longProfitHit(false),
shortStopHit(false),
shortProfitHit(false),
entryPrice(0),
stopPrice(0),
profitPrice(0);
// ÁøÀÔ Á¶°Ç
if (MarketPosition = 0) then begin
entryPrice = 0; // ÃʱâÈ
stopPrice = 0;
profitPrice = 0;
// ¸Å¼ö Á¶°Ç
if (not longEntered) then begin
buy("LongEntry") next bar at close + 10 limit;
end;
// ¸Åµµ Á¶°Ç
if (not shortEntered) then begin
sellshort("ShortEntry") next bar at close - 10 limit;
end;
end;
// ·Õ Æ÷Áö¼Ç ÁøÀÔ ½Ã
if (MarketPosition = 1 and entryPrice = 0) then begin
entryPrice = FilledAvgPrice;
stopPrice = entryPrice - (30 * TickSize);
profitPrice = entryPrice + (200 * TickSize);
longEntered = true;
end;
// ¼ô Æ÷Áö¼Ç ÁøÀÔ ½Ã
if (MarketPosition = -1 and entryPrice = 0) then begin
entryPrice = FilledAvgPrice;
stopPrice = entryPrice + (30 * TickSize);
profitPrice = entryPrice - (200 * TickSize);
shortEntered = true;
end;
// ·Õ Æ÷Áö¼Ç û»ê Á¶°Ç
if (MarketPosition = 1) then begin
if (not longStopHit) then begin
sell("LongStopLoss") next bar at stopPrice stop;
longStopHit = true;
end;
if (not longProfitHit) then begin
sell("LongTakeProfit") next bar at profitPrice limit;
longProfitHit = true;
end;
end;
// ¼ô Æ÷Áö¼Ç û»ê Á¶°Ç
if (MarketPosition = -1) then begin
if (not shortStopHit) then begin
buytocover("ShortStopLoss") next bar at stopPrice stop;
shortStopHit = true;
end;
if (not shortProfitHit) then begin
buytocover("ShortTakeProfit") next bar at profitPrice limit;
shortProfitHit = true;
end;
end;
2,
¿À·ù ¼öÁ¤ ºÎŹ µå·Á¿ä °¨»çÇÕ´Ï´Ù
// ÇöÀç°¡ ±âÁØ ÁöÁ¤°¡ ¸Å¼ö/¸Åµµ, ¼ÕÀý/ÀÍÀý, 1ȸ¸¸ ¼öÇàÇÏ´Â Àü·«
// Àü¿ª º¯¼ö ¼±¾ð
vars:
longEntered(false),
shortEntered(false),
longStopHit(false),
longProfitHit(false),
shortStopHit(false),
shortProfitHit(false),
entryPrice(0),
stopPrice(0),
limitPrice(0),
profitPrice(0),
lossPrice(0);
// Àü·« Á¶°Ç ¼±¾ð
if (MarketPosition = 0) then begin
// ¸Å¼ö Á¶°Ç: ÇöÀç Á¾°¡ +10¿¡ ÁöÁ¤°¡ ¸Å¼ö
if (not longEntered) then begin
buy("LongEntry") next bar at close + 10 limit;
end;
// ¸Åµµ Á¶°Ç: ÇöÀç Á¾°¡ -10¿¡ ÁöÁ¤°¡ ¸Åµµ
if (not shortEntered) then begin
sellshort("ShortEntry") next bar at close - 10 limit;
end;
end;
// ÁøÀÔ ÈÄ Æ÷Áö¼ÇÀÌ ¿¸®¸é °¡°Ý ÀúÀå
if (MarketPosition = 1 and entryPrice = 0) then begin
entryPrice = FilledAvgPrice;
// ¼ÕÀý°¡¿Í ÀÍÀý°¡ °è»ê
stopPrice = entryPrice - (30 * ticksize); // ¼ÕÀý 30ƽ
profitPrice = entryPrice + (200 * ticksize); // ÀÍÀý 200ƽ
end;
if (MarketPosition = -1 and entryPrice = 0) then begin
entryPrice = FilledAvgPrice;
stopPrice = entryPrice + (30 * ticksize); // ¼ÕÀý 30ƽ (Ç϶ôÀÌ´Ï±î ´õÇϱâ)
profitPrice = entryPrice - (200 * ticksize); // ÀÍÀý 200ƽ
end;
// ¼ÕÀý/ÀÍÀý ÁÖ¹®
if (MarketPosition = 1) then begin
if (not longStopHit) then begin
sell("LongStopLoss") next bar at stopPrice stop; // ¼ÕÀý
longStopHit = true;
end;
if (not longProfitHit) then begin
sell("LongTakeProfit") next bar at limitPrice = profitPrice limit; // ÀÍÀý
longProfitHit = true;
end;
end;
if (MarketPosition = -1) then begin
if (not shortStopHit) then begin
buytocover("ShortStopLoss") next bar at stopPrice stop;
shortStopHit = true;
end;
if (not shortProfitHit) then begin
buytocover("ShortTakeProfit") next bar at limitPrice = profitPrice limit;
shortProfitHit = true;
end;
end;
// Á¶°ÇÀÌ ÃæÁ·µÇ¸é ÇÑ ¹ø¸¸ ¼öÇàÇϱâ À§ÇØ bool º¯¼ö·Î Â÷´Ü
// ÇѹøÁøÀÔ/¼ÕÀý/ÀÍÀý ÈÄ ÀçÁøÀÔ ¹æÁö
// ´Ù½Ã ÁøÀÔÇÏ·Á¸é Àü·« ÃʱâÈ ÇÊ¿ä
¹®ÀÇ µå¸³´Ï´Ù
Á¾¸ñ°Ë»ö½Ä ¿äûµå¸³´Ï´Ù.
°ü·Ã ±Û ¸®½ºÆ®
ÇöÀç±Û
¸¶Áö¸· Èñ¸Á
¿ìÀ¯
2025.06.11
22
Re : ¸¶Áö¸· Èñ¸Á
¿¹½º½ºÅ¹
2025.06.12
10