Cara simple cari cuan di saham pakai @Stockbit -> excel -> amibroker

1. Bikin screener Bandarmologi + FA ( bikin 3-4 variasi ) hasilnya random cek ulang di bandar detektor
2. Hasil Screener di save ke csv ( bisa jadi dapat 3 -4 file)
3. Bikin macro di excel yang berguna import file hasil simpan screener agar menjadi 1 dan hapus apabila ada duplicate .terus export jadi File *.tls . contoh sederhana macronya
//==============================================================
Sub KumpulkanKolomA_CSV_Optimasi_Dan_SimpanTLS()
Dim wb As Workbook
Dim ws As Worksheet
Dim wsResult As Worksheet
Dim folderPath As String
Dim fileName As String
Dim lastRow As Long
Dim resultRow As Long
Dim dataRange As Range
Dim outputFile As String
Dim customFileName As String
Dim fileCount As Integer

' Tetapkan path folder
folderPath = "C:\Data\ExcelFiles\" ' Path folder sesuai permintaan

' Pastikan path diakhiri dengan backslash
If Right(folderPath, 1) <> "\" Then folderPath = folderPath & "\"

' Periksa apakah folder ada
If Dir(folderPath, vbDirectory) = "" Then
MsgBox "Folder " & folderPath & " tidak ditemukan! Periksa path.", vbExclamation
Exit Sub
End If

' Input box untuk memasukkan nama file kustom
customFileName = InputBox("Masukkan nama file (tanpa ekstensi .tls):", "Nama File Kustom")
If customFileName = "" Then
MsgBox "Nama file tidak boleh kosong! Proses dibatalkan.", vbExclamation
Exit Sub
End If

' Buat worksheet baru dengan nama kustom
On Error Resume Next
ThisWorkbook.Sheets(customFileName).Delete
On Error GoTo 0
Set wsResult = ThisWorkbook.Sheets.Add
https://cutt.ly/wrTbvUmE = customFileName ' Gunakan nama kustom untuk tab worksheet
resultRow = 1 ' Mulai menulis data di baris 1

' Nonaktifkan pembaruan layar untuk percepatan
Application.ScreenUpdating = False
Application.DisplayAlerts = False

' Cari file CSV di folder
fileName = Dir(folderPath & "*.csv") ' Mencari file .csv

' Jika tidak ada file CSV
If fileName = "" Then
MsgBox "Tidak ada file .csv di folder " & folderPath & "! Periksa folder.", vbExclamation
Exit Sub
End If

' Loop melalui semua file CSV
Do While fileName <> ""
' Buka file CSV
Set wb = https://cutt.ly/1rTbvUOH(folderPath & fileName)
Set ws = wb.Sheets(1) ' Ambil sheet pertama

' Temukan baris terakhir di kolom A
lastRow = ws.Cells(ws.Rows.Count, 1).End(xlUp).Row

' Salin data dari kolom A (lewati header jika ada)
If lastRow > 1 Then ' Asumsi baris 1 adalah header
Set dataRange = ws.Range("A2:A" & lastRow)
dataRange.Copy Destination:=wsResult.Cells(resultRow, 1)
resultRow = wsResult.Cells(wsResult.Rows.Count, 1).End(xlUp).Row + 1
ElseIf lastRow = 1 And ws.Cells(1, 1).Value <> "" Then ' Jika hanya ada header
ws.Cells(1, 1).Copy Destination:=wsResult.Cells(resultRow, 1)
resultRow = resultRow + 1
End If

' Tutup file tanpa menyimpan perubahan
wb.Close SaveChanges:=False
fileName = Dir ' Ambil file berikutnya
Loop

' Hapus duplikat
With wsResult
lastRow = .Cells(.Rows.Count, 1).End(xlUp).Row
If lastRow > 1 Then
On Error Resume Next
.Range("A1:A" & lastRow).RemoveDuplicates Columns:=1, Header:=xlNo
On Error GoTo 0
End If
End With

' Urutkan data secara alfabet
With wsResult
lastRow = .Cells(.Rows.Count, 1).End(xlUp).Row
If lastRow > 1 Then
.Range("A1:A" & lastRow).Sort Key1:=.Range("A1"), Order1:=xlAscending, Header:=xlNo
End If
End With

' Tentukan nama file dengan tanggal dan waktu, pastikan unik
outputFile = folderPath & customFileName & "_" & Format(Now, "yymmdd_hhmm") & ".tls"
Do While Dir(outputFile) <> ""
outputFile = folderPath & customFileName & "_" & Format(Now, "yymmdd_hhmmss") & ".tls" ' Tambah detik jika ada konflik
Loop

' Simpan hasil ke file .tls dengan nama kustom dan tanggal/waktu
Open outputFile For Output As #1
With wsResult
lastRow = .Cells(.Rows.Count, 1).End(xlUp).Row
If lastRow >= 1 Then
For i = 1 To lastRow
If Not IsEmpty(.Cells(i, 1)) Then
Print #1, .Cells(i, 1).Value
End If
Next i
End If
End With
Close #1

' Aktifkan kembali pembaruan layar
Application.ScreenUpdating = True
Application.DisplayAlerts = True

MsgBox "Proses selesai! Hasil disimpan sebagai " & outputFile & " dan tab worksheet bernama " & customFileName, vbInformation
End Sub

//==============================================================

4. impor hasil menjadi WL di amibroker.
5. jalankan screener TA , pilih saja sesuai Trading system yang ada.

ketemu emiten yang sepertinya akan naik. $CASA $INCO $EXCL TBLA TOBA kita lihat minggu ini.

Proses paling memakan waktu 5-10 menit asal dikerjain. 馃榿 馃榿
Mudah bukan ?.?... Klik klak klik. beres. selesaia . wwwkkkw

Read more...

1/4

testestestes
2013-2025 Stockbit 路AboutContactHelpHouse RulesTermsPrivacy