Poyarkov696
1
All posts from Poyarkov696
  Poyarkov696 in Poyarkov696,

Робот - торговец волатильностью

PORTFOLIO_EX drivepower;
DESCRIPTION drivepower;
CLIENTS_LIST ALL_CLIENTS;
FIRMS_LIST ALL_FIRMS;

INCLUDE func_gr.txt;

PROGRAM
NEW_GLOBAL ("orders","")
NEW_GLOBAL ("ClassCodeList","")
NEW_GLOBAL ("Instrument","")
NEW_GLOBAL ("step",0)
NEW_GLOBAL ("kolpoint",0)
NEW_GLOBAL ("kolinpoint",0)
NEW_GLOBAL ("outpoint",0)
NEW_GLOBAL ("shares",0)
NEW_GLOBAL ("startpoint",0)
NEW_GLOBAL ("cash",0)
NEW_GLOBAL ("total",0)
NEW_GLOBAL ("minout",0)
NEW_GLOBAL ("maxout",0)
NEW_GLOBAL ("roll",0)

NEW_GLOBAL ("first_start", 1)
NEW_GLOBAL ("error", 0)
path="C:\program1\drivepower\"
file_logS = path & "logS.txt"
file_path = path & "save.txt"
file_kill = path & "killer.txt"
file_start = path & "startpoint.txt"
file_param = path & "param.txt"
IF first_start == 1
startpoint = str2num(READ_LINE (file_start, 1, error))' точка запуска системы
shares = str2num(READ_LINE (file_start, 2, error))' количество купденных контрактов
cash = str2num(READ_LINE (file_start, 3, error))' количество купденных контрактов


ClassCodeList = READ_LINE (file_param, 1*2, error)' код класса инструмента
Instrument = READ_LINE (file_param, 2*2, error)' название инструмента
step = str2num(READ_LINE (file_param, 3*2, error))' шаг
kolpoint = str2num(READ_LINE (file_param, 4*2, error))' количество точек
kolinpoint = str2num(READ_LINE (file_param, 5*2, error))' количество в одной точке
outpoint = str2num(READ_LINE (file_param, 6*2, error))'точка выхода %
roll = str2num(READ_LINE (file_param, 7*2, error))'передвигать заявки
eveningkill = str2num(READ_LINE (file_param, 8*2, error))'передвигать заявки
DELETE_ALL_ITEMS()
orders = READ_LINE (file_path, 1, error)
first_start = 0
end if

kill=0
kill= str2num(READ_LINE (file_kill, 1, error))





CurrentHour = GET_VALUE(GET_DATETIME(), "HOUR")
CurrentMin = GET_VALUE(GET_DATETIME(), "MIN")
CurrentSec = GET_VALUE(GET_DATETIME(), "SEC")
CurrentTime = str2num(fTextTime(CurrentHour,CurrentMin,CurrentSec) & "")


CurrentYear = GET_VALUE(GET_DATETIME(), "YEAR")
CurrentMonth = GET_VALUE(GET_DATETIME(), "MONTH")
CurrentDay = GET_VALUE(GET_DATETIME(), "DAY")
CurrentData = str2num(fTextData(CurrentYear,CurrentMonth,CurrentDay) & "")
price = get_param(ClassCodeList,Instrument,"last")
if (price0)and(minout=0)and(maxout=0)
minout=price-price/100*outpoint
maxout=price+price/100*outpoint
end if
IF ((CurrentTime >= 184600) AND (CurrentTime
CLEAR_FILE (file_path)
end if
if (kill=1)or((eveningkill=1)and(((CurrentTime >= 182900) AND (CurrentTime