input : ÃÑÅõÀÚ±Ý(4500000), period1(20); var : L10(0),cnt(0),sum(0),count(0); sum = 0; for count = 1 to Period1{ sum = sum + max(abs(dayclose(count+1)-DayHigh(count)),abs(Dayclose(count+1)-DayLow(count)),abs(dayhigh(count)-daylow(count))); } value1 = sum/period1; #Àϰ£ 20 ATR value2 = int(ÃÑÅõÀÚ±Ý*0.01)/(value1*3); value6 = 167000; #¹Ú½º±Ç»ó´Ü value7 = 159400; #¹Ú½º±Ç±Í¼Ó value8 = 163000; #ÀüÀÏ ±âÁØ 10ÀÏ ÃÖÀú°¡ L10 = DayLow(1); for cnt = 1 to 10{ if DayLow(cnt) < L10 Then L10 = DayLow(cnt); } if MarketPosition == 0 and stime < 150000 and sdate >= 20100701 and ExitDate(1) != sdate Then{ if H <= value6 Then# ¸Å¼ö°¡°Ý´ë µ¹ÆÄ½Ã ¸Å¼ö. buy("first¹Ú½º±ÇÀÌÅ»¸Å¼ö",AtStop,value6+PriceScale,value2); } #ÁøÀÔÀÌ ÀÖÀ» ¶§¸¶´Ù value3¿¡ value1ÀúÀå value4¿¡ ÇØ´çºÀ °í°¡ÀúÀå if MarketPosition == 1 and CurrentEntries > CurrentEntries[1] Then{ value3 = value1; value4 = H; } if MarketPosition == 1 and ExitDate(1) != sdate and countif(L < value8,BarsSinceEntry) < 1 Then{ if CurrentEntries == 1 Then{ buy("Áß°£ÇǶó¹Ìµù",AtStop,H[BarsSinceEntry]+value3+PriceScale,value2); } if CurrentEntries == 2 Then{ buy("¸¶Áö¸·ÇǶó¹Ìµù",AtStop,value4+value3+PriceScale,value2); } } if MarketPosition == 1 and ExitDate(1) != sdate then{ #ÁøÀÔÀÌÈÄ¿¡ Çѹø¸¸ value8À» ÇÏÇâÇϸé ÁøÀÔ if CurrentEntries == 1 and countif(L < value8,BarsSinceEntry) < 1 Then buy("b1",atlimit,value8,value2); #Àú°¡°¡ value8À» ÇÏÇâÇÑÀûÀÌ ÀÖÀ» °æ¿ì(Áï b1ÀÌ ÁøÀÔÇÑÀûÀÌ ÀÖ°í),value6+value1À» »óÇâÇÏ¸é ¸Å¼ö if CurrentEntries == 2 and countif(L <= value8,BarsSinceEntry) >= 1 and H < value6+value1 Then buy("b2",atlimit,value6+value1,value2); } if MarketPosition == 1 Then{ if L >= L10-PriceScale Then# ºÎµîÈ£°¡ ¹Ý´ëÀ̾î¾ß L7-PriceScale À§¿¡ ÀÖ´Ù°¡ ³»·Á°¡¸é û»êÀÔ´Ï´Ù. exitlong("½ÅÀú°¡",AtStop,L10-PriceScale); if L >= value4-value3*3 then # value4-value3*3 À§¿¡ ÀÖ´Ù°¡ ³»·Á°¡¸é û»êÀÔ´Ï´Ù. exitlong("º¯µ¿¼º",AtStop,value4-value3*3); if L >= value6-value3*3 Then exitlong("¼Õ½Çû»ê",atstop,value6-value3*3); #¹Ú½º±ÇÇÏÇâÇϸé û»ê. if L >= value7 Then exitlong("¹Ú½º±Ç±Í¼Ó",atstop,value7-pricescale); #¹Ú½º±ÇÇÏÇâÇϸé û»ê. }