Параболик 1.0

Программы предоставляют на безвозмездной основе для некоммерческого использования
Правила форума
Торговые роботы в данном разделе находятся в свободном доступе для всех для не коммерческого использования.

Re: Параболик 1.0

Сообщение Евгений Черных » 11 дек 2017, 15:03

Здравствуйте!

Пришлите нам, пожалуйста, необрезанный снимок экрана, на котором четко видно указанную проблему и настройки робота. Сделать его можно вот так. http://kbrobot.ru/printscreen.html/
Все бесплатные роботы тут https://vk.com/board98605354
Аватара пользователя
Евгений Черных
Администратор
 
Сообщения: 7370
Зарегистрирован: 01 ноя 2013, 12:11

Re: Параболик 1.0

Сообщение Руба » 11 дек 2017, 15:38

Изображение
func get_market(class_code)
market=""

if ((class_code&""=="TQNE") or (class_code&""=="TQBR") or (class_code&""=="TQNL") or (class_code&""=="TQLV") or (class_code&""=="TQLV") or (class_code&""=="TQBS") or (class_code&""=="RTSST"))
market="micex"
end if

if ((class_code&""=="SPBFUT"))
market="forts"
end if

result=market

end func

func get_class(security_code)
EQNE = GET_CLASS_SECURITIES ("EQNE")
EQBR = GET_CLASS_SECURITIES ("EQBR")
EQNL = GET_CLASS_SECURITIES ("EQNL")
EQLI = GET_CLASS_SECURITIES ("EQLI")
EQLV = GET_CLASS_SECURITIES ("EQLV")
EQBS = GET_CLASS_SECURITIES ("EQBS")

TQNE = GET_CLASS_SECURITIES ("TQNE")
TQBR = GET_CLASS_SECURITIES ("TQBR")
TQNL = GET_CLASS_SECURITIES ("TQNL")
TQLI = GET_CLASS_SECURITIES ("TQLI")
TQLV = GET_CLASS_SECURITIES ("TQLV")
TQBS = GET_CLASS_SECURITIES ("TQBS")

GTS = GET_CLASS_SECURITIES ("GTS")
SPBFUT = GET_CLASS_SECURITIES ("SPBFUT")
RTSST = GET_CLASS_SECURITIES ("RTSST")
class=""

for sec_code in TQNE

if sec_code==security_code
class="TQNE"
break
end if

end for

for sec_code in TQBR

if sec_code==security_code
class="TQBR"
break
end if

end for

for sec_code in TQNL

if sec_code==security_code
class="TQNL"
break
end if

end for

for sec_code in TQLI
if sec_code==security_code
class="TQLI"
break
end if
end for

for sec_code in TQLV
if sec_code==security_code
class="TQLV"
break
end if
end for

for sec_code in TQBS
if sec_code==security_code
class="TQBS"
break
end if
end for

for sec_code in EQNE

if sec_code==security_code
class="EQNE"
break
end if

end for

for sec_code in EQBR

if sec_code==security_code
class="EQBR"
break
end if

end for

for sec_code in EQNL

if sec_code==security_code
class="EQNL"
break
end if

end for

for sec_code in EQLI
if sec_code==security_code
class="EQLI"
break
end if
end for

for sec_code in EQLV
if sec_code==security_code
class="EQLV"
break
end if
end for

for sec_code in EQBS
if sec_code==security_code
class="EQBS"
break
end if
end for

for sec_code in GTS
if sec_code==security_code
class="GTS"
break
end if
end for

for sec_code in SPBFUT
if sec_code==security_code
class="SPBFUT"
break
end if
end for

'for sec_code in RTSST
'if sec_code==security_code
'class="RTSST"
'break
'end if
'end for

result=class

end func


func time()

time=get_datetime()
year=get_value(time,"YEAR")
month=get_value(time,"MONTH")
day=get_value(time,"DAY")
minute=get_value(time,"MIN")
hour=get_value(time,"HOUR")
sec=get_value(time,"SEC")
curdate=year*10000+month*100+day
curtime=hour*10000+minute*100+sec

res=0
if market="forts" or class&""=="RTSST"
if (curtime>100001 and curtime<135940) or (curtime>140303 and curtime<184400) or (curtime>190005 and curtime<234500)
res=1
end if
end if

if market="micex" and class&""!="RTSST"
if (curtime>100010 and curtime<184450)
res=1
end if
end if

work=0
IF (0 + IS_CONNECTED() = 1)
seconline=SUBSTR(Get_Info_Param("CONNECTIONTIME"),6,2)
minonline=SUBSTR(Get_Info_Param("CONNECTIONTIME"),3,2)
houronline=SUBSTR(Get_Info_Param("CONNECTIONTIME"),0,2)
if (((houronline+0)>1) or ((minonline+0)>1) or ((seconline+0)>20))
work=1
end if
end if



if (work+0)=1
result=res
else
res=0
end if


end func

func get_total_net(market,client,code)


if market="micex" or class&""=="RTSST"

n=GET_NUMBER_OF("DEPO_LIMITS")
cur_bal_lim=0
TOTAL_NET=0


FOR i FROM 1 to n
limit = GET_ITEM ("DEPO_LIMITS", i)

LIMIT_KIND= GET_VALUE (limit, "LIMIT_KIND")&""
sch= GET_VALUE (limit, "CLIENT_CODE")
sec_t=GET_VALUE (limit, "SECCODE")

if sch==client and LIMIT_KIND&""=="2" and sec_t==code
TOTAL_NET=GET_VALUE (limit, "CURRENT_BALANCE")
usl=1
break
end if

END FOR
result=TOTAL_NET
end if

if market="forts" and class&""!="RTSST"
n=GET_NUMBER_OF("FUTURES_CLIENT_HOLDINGS")
TOTAL_NET=0

FOR i FROM 1 to n
limit = GET_ITEM ("FUTURES_CLIENT_HOLDINGS", i)
sch= GET_VALUE (limit, "TRDACCID")
sec_t=GET_VALUE (limit, "SECCODE")

if sch=client
if sec_t=code
TOTAL_NET=GET_VALUE (limit, "TOTAL_NET")+0
end if
end if

END FOR

result=TOTAL_NET
end if

end func


func get_open_net(market,client,code)


if market="micex"

n=GET_NUMBER_OF("DEPO_LIMITS")
cur_bal_lim=0
OPEN_NET=0


FOR i FROM 1 to n
limit = GET_ITEM ("DEPO_LIMITS", i)

sch= GET_VALUE (limit, "CLIENT_CODE")
sec_t=GET_VALUE (limit, "SECCODE")

if sch=client
if sec_t=code
OPEN_NET=GET_VALUE (limit, "OPEN_BALANCE")
usl=1
break
end if
end if

END FOR
result=OPEN_NET
end if

if market="forts"
n=GET_NUMBER_OF("FUTURES_CLIENT_HOLDINGS")
OPEN_NET=0

FOR i FROM 1 to n
limit = GET_ITEM ("FUTURES_CLIENT_HOLDINGS", i)
sch= GET_VALUE (limit, "TRDACCID")
sec_t=GET_VALUE (limit, "SECCODE")

if sch=client
if sec_t=code
OPEN_NET=GET_VALUE (limit, "START_NET")+0
end if
end if

END FOR

result=OPEN_NET
end if

end func

func get_CBPLPLANNED(market,client)



if market="micex"

n=GET_NUMBER_OF("MONEY_LIMITS")
usl=0
CBPLPLANNED=0

FOR i FROM 1 to n
limit = GET_ITEM ("MONEY_LIMITS", i)
sch = GET_VALUE (limit, "CLIENT_CODE")

if usl=0
if sch=client
usl=1
CBPLPLANNED=GET_VALUE (limit, "CURRENT_BALANCE")+0
break
end if
end if
END FOR
result=CBPLPLANNED
end if

if market="forts"
n=GET_NUMBER_OF("FUTURES_CLIENT_LIMITS")
CBPLPLANNED=0
usl=0
FOR i FROM 1 to n
limit = GET_ITEM ("FUTURES_CLIENT_LIMITS", i)
sch = GET_VALUE (limit, "TRDACCID")

if usl=0
if sch=client
CBPLPLANNED=GET_VALUE (limit, "CBPLPLANNED")+0
usl=1
end if
end if
END FOR

result=CBPLPLANNED
end if



end func

func get_profit(code_profit)
n=get_number_of("TRADES")
summ=0
start_net_trades=get_open_net(market,client,code)



if market="micex"
price_close=get_value(get_candle(id_base,true_date,184400,0),"close")
end if
if market="forts"
price_close=get_value(get_candle(id_base,true_date,235000,0),"close")
end if
message(price_close,1)

if (start_net_trades+0)>620
summ=summ-(start_net_trades-620)*price_trades
end if

if (start_net_trades+0)<620
summ=summ+(620-start_net_trades)*price_trades
end if

for i from 1 to n
str_trades=get_item("TRADES",i)
seccode_trades=get_value(str_trades,"SECCODE")
operation_trades=get_value(str_trades,"OPERATION")
quantity_trades=get_value(str_trades,"QUANTITY")
price_trades=get_value(str_trades,"PRICE")

if seccode_trades&""==code_profit

if operation_trades&""="BUY"
summ=summ-quantity_trades*price_trades
end if
if operation_trades&""="SELL"
summ=summ+quantity_trades*price_trades
end if

end if

end for

if (total_net+0)>620
summ=summ+(total_net-620)*last
end if
if (total_net+0)<620
summ=summ-(620-total_net)*last
end if

'result=summ
end func

FUNC operation(client,depo,operation,price,quantity,seccode,classcode,market)

new_global("trans_params", "")
new_global("trans_result", "")

trans_params = ""
trans_params = set_value (trans_params, "TRANS_ID", "1")
trans_params = set_value (trans_params, "ACTION", "NEW_ORDER")
trans_params = set_value (trans_params, "CLASSCODE", classcode)
trans_params = set_value (trans_params, "SECCODE",seccode)

if (market&"")=="micex"
trans_params = set_value (trans_params, "ACCOUNT",depo)
trans_params = set_value (trans_params, "CLIENT_CODE", client)
end if

if (market&"")=="forts"
trans_params = set_value (trans_params, "ACCOUNT",client)
trans_params = set_value (trans_params, "CLIENT_CODE","")
end if


trans_params = set_value (trans_params, "OPERATION", operation)
trans_params = set_value (trans_params, "QUANTITY", quantity)
trans_params = set_value (trans_params, "TYPE", "L")
trans_params = set_value (trans_params, "PRICE", price)
trans_result=SEND_TRANSACTION (30, trans_params)


curr_datetime=Get_DateTime()
WRITELN ("qpile_trans.log", get_value (curr_datetime, "DATETIME") & ": " & "Result: " & get_value (trans_result, "RESULT") & ", Result_ex: " & get_value (trans_result, "RESULT_EX") & ", OrderNum: " & get_value (trans_result, "ORDER_NUMBER") & ", Description: " & get_value (trans_result, "DESCRIPTION"))

END FUNC


FUNC stop_order(client,depo,operation,price,stopprice,quantity,seccode,classcode,market)

trans_params = ""
trans_params = set_value (trans_params, "TRANS_ID", 1)
trans_params = set_value (trans_params, "ACTION", "NEW_STOP_ORDER")
trans_params = set_value (trans_params, "CLASSCODE", classcode)
trans_params = set_value (trans_params, "SECCODE",seccode)

if (market&"")=="micex"
trans_params = set_value (trans_params, "ACCOUNT",depo)
trans_params = set_value (trans_params, "CLIENT_CODE", client)
end if

if (market&"")=="forts"
trans_params = set_value (trans_params, "ACCOUNT",client)
trans_params = set_value (trans_params, "CLIENT_CODE","")
end if



trans_params = set_value (trans_params, "OPERATION", operation)
trans_params = set_value (trans_params, "QUANTITY", quantity)
trans_params = set_value (trans_params, "TYPE", "L")
trans_params = set_value (trans_params, "PRICE", price)
trans_params = set_value (trans_params, "STOPPRICE", stopprice)
trans_params = set_value (trans_params, "EXPIRY_DATE","GTC")

trans_result=SEND_TRANSACTION (30, trans_params)

curr_datetime=Get_DateTime()
WRITELN ("qpile_trans.log", get_value (curr_datetime, "DATETIME") & ": " & "Result: " & get_value (trans_result, "RESULT") & ", Result_ex: " & get_value (trans_result, "RESULT_EX") & ", OrderNum: " & get_value (trans_result, "ORDER_NUMBER") & ", Description: " & get_value (trans_result, "DESCRIPTION"))
stop_number=get_value (trans_result, "ORDER_NUMBER")+0


END FUNC

FUNC trailing_stop(client,depo,operation,stop_price,offset,SPREAD,quantity,seccode,classcode,market)

new_global("trans_params", "")
new_global("trans_result", "")

trans_params = ""
trans_params = set_value (trans_params, "TRANS_ID", "1")
trans_params = set_value (trans_params, "ACTION", "NEW_STOP_ORDER")
trans_params = set_value (trans_params, "STOP_ORDER_KIND", "TAKE_PROFIT_STOP_ORDER")
trans_params = set_value (trans_params, "CLASSCODE", classcode)
trans_params = set_value (trans_params, "SECCODE",seccode)

if (market&"")=="micex"
trans_params = set_value (trans_params, "ACCOUNT",depo)
trans_params = set_value (trans_params, "CLIENT_CODE", client)
end if

if (market&"")=="forts"
trans_params = set_value (trans_params, "ACCOUNT",client)
trans_params = set_value (trans_params, "CLIENT_CODE","")
end if


trans_params = set_value (trans_params, "OPERATION", operation)
trans_params = set_value (trans_params, "QUANTITY", quantity)
trans_params = set_value (trans_params, "TYPE", "L")
trans_params = set_value (trans_params, "STOPPRICE", stop_price)
trans_params = set_value (trans_params, "OFFSET", OFFSET)
trans_params = set_value (trans_params, "OFFSET_UNITS", "PRICE_UNITS")
trans_params = set_value (trans_params, "SPREAD", spread)
trans_params = set_value (trans_params, "SPREAD_UNITS", "PRICE_UNITS")
trans_params = set_value (trans_params, "EXPIRY_DATE","GTC")
trans_result=SEND_TRANSACTION (30, trans_params)

take_order=get_value (trans_result,"ORDER_NUMBER")
curr_datetime=Get_DateTime()
WRITELN ("qpile_trans.log", get_value (curr_datetime, "DATETIME") & ": " & "Result: " & get_value (trans_result, "RESULT") & ", Result_ex: " & get_value (trans_result, "RESULT_EX") & ", OrderNum: " & get_value (trans_result, "ORDER_NUMBER") & ", Description: " & get_value (trans_result, "DESCRIPTION"))

END FUNC



FUNC binded_stop(client,depo,operation,stop_price,price,linked_price,quantity,seccode,classcode,market)


new_global("trans_params", "")
new_global("trans_result", "")

trans_params = ""
trans_params = set_value (trans_params, "TRANS_ID", "1")
trans_params = set_value (trans_params, "ACTION", "NEW_STOP_ORDER")
trans_params = set_value (trans_params, "STOP_ORDER_KIND", "WITH_LINKED_LIMIT_ORDER")
trans_params = set_value (trans_params, "CLASSCODE", classcode)
trans_params = set_value (trans_params, "SECCODE",seccode)

if (market&"")=="micex"
trans_params = set_value (trans_params, "ACCOUNT",depo)
trans_params = set_value (trans_params, "CLIENT_CODE", client)
end if

if (market&"")=="forts"
trans_params = set_value (trans_params, "ACCOUNT",client)
trans_params = set_value (trans_params, "CLIENT_CODE","")
end if


trans_params = set_value (trans_params, "OPERATION", operation)
trans_params = set_value (trans_params, "QUANTITY", quantity)
trans_params = set_value (trans_params, "TYPE", "L")
trans_params = set_value (trans_params, "STOPPRICE", stop_price)
trans_params = set_value (trans_params, "PRICE", price)
trans_params = set_value (trans_params, "LINKED_ORDER_PRICE", linked_price)
trans_params = set_value (trans_params, "KILL_IF_LINKED_ORDER_PARTLY_FILLED", "NO")
trans_result=SEND_TRANSACTION (30, trans_params)

binded_stop_number=get_value (trans_result,"ORDER_NUMBER")
curr_datetime=Get_DateTime()
WRITELN ("qpile_trans.log", get_value (curr_datetime, "DATETIME") & ": " & "Result: " & get_value (trans_result, "RESULT") & ", Result_ex: " & get_value (trans_result, "RESULT_EX") & ", OrderNum: " & get_value (trans_result, "ORDER_NUMBER") & ", Description: " & get_value (trans_result, "DESCRIPTION"))

END FUNC



FUNC kill_stop_order(orderkey,classcode,seccode)


trans_params = ""
trans_params = SET_VALUE(trans_params,"CLASSCODE",classcode)
trans_params = set_value (trans_params, "SECCODE",seccode)
trans_params = SET_VALUE(trans_params,"TRANS_ID","1")
trans_params = SET_VALUE(trans_params,"ACTION","KILL_STOP_ORDER")
trans_params = set_value (trans_params, "OPERATION", "s")
trans_params = SET_VALUE(trans_params,"STOP_ORDER_KEY",orderkey)
trans_result = SEND_TRANSACTION (30,trans_params)


curr_datetime=Get_DateTime()
WRITELN ("qpile_trans.log", get_value (curr_datetime, "DATETIME") & ": " & "Result: " & get_value (trans_result, "RESULT") & ", Result_ex: " & get_value (trans_result, "RESULT_EX") & ", OrderNum: " & get_value (trans_result, "ORDER_NUMBER") & ", Description: " & get_value (trans_result, "DESCRIPTION"))

END FUNC



FUNC get_candle(id,date,time,line_id)
candle=create_map()
slice = Get_Candle_Ex(id, date,time)
time =Get_Value(slice,"TIME")
lines=Get_Value(slice,"LINES")
line=Get_Collection_Item(lines, line_id)
close=Get_Value(line,"CLOSE")+0
high=Get_Value(line,"HIGH")+0
low=Get_Value(line,"LOW")+0
open=Get_Value(line,"OPEN")+0
candle=set_value(candle,"open",open)
candle=set_value(candle,"high",high)
candle=set_value(candle,"low",low)
candle=set_value(candle,"close",close)
candle=set_value(candle,"time",time)
result=candle
end func


FUNC get_prices(id,market)
sdelka=get_info_param("USERID")+115
if id&""!=""
new_global("cur_time_bar_pred",0)
new_global("close_pred",0)
new_global("open_pred",0)
new_global("high_pred",0)
new_global("low_pred",0)

time=get_datetime()
hour=get_value(time,"HOUR")
min=get_value(time,"MIN")
day=get_value(time,"DAY")
month=get_value(time,"MONTH")
year=get_value(time,"YEAR")
cur_date=year*10000+month*100+day
cur_time=hour*10000+min*100
true_date=0

for i from 0 to 100000

candle=get_candle(id,cur_date,183000,0)

if (get_value(candle,"open")+0)=0

if (day+0)<2
month=month-1
day=32
if month=0
month=12
year=year-1
end if
end if


day=day-1
cur_date=year*10000+month*100+day
else
true_date=cur_date
break
end if

end for

timeframe_collection=create_collection()
hour=18
min=30
time=hour*10000+min*100
pred_time="0"
j=0
timeframe=""

for i from 0 to 1000

candle=get_candle(id,true_date,time,0)

if (get_value(candle,"time")+0)=0
timeframe="day"
break
end if

if get_value(candle,"time")&""=pred_time&""
else
timeframe_collection=insert_collection_item(timeframe_collection,j,get_value(candle,"time"))
pred_time=get_value(candle,"time")
j=j+1
end if


if (min+0)=0
hour=hour-1
min=59
else
min=min-1
end if

time=hour*10000+min*100

if (get_collection_count(timeframe_collection)+0)>1
break
end if

end for


dateframe_collection=create_collection()
counter=0
time=get_datetime()
day=get_value(time,"DAY")
month=get_value(time,"MONTH")
year=get_value(time,"YEAR")
cur_date=year*10000+month*100+day
pred_open=0
pred_high=0
pred_close=0
pred_low=0
if (timeframe&"")=="day"
for i from 0 to 1000
candle=get_candle(id,cur_date,150000,0)

if ((get_value(candle,"open")+0)!=(pred_open+0) or (get_value(candle,"high")+0)!=(pred_high+0) or (get_value(candle,"close")+0)!=(pred_close+0))
if ((get_value(candle,"close")+0)!=0)
dateframe_collection=INSERT_COLLECTION_ITEM(dateframe_collection,counter,cur_date)
pred_open=get_value(candle,"open")
pred_high=get_value(candle,"high")
pred_close=get_value(candle,"close")
counter=counter+1
end if
end if

if (day+0)=1
month=month-1
day=32
if (month+0)=0
month=12
year=year-1
end if
end if
day=day-1

if get_collection_count(dateframe_collection)>20
break
end if

cur_date=year*10000+month*100+day
end for
end if



hour1=SUBSTR (get_collection_item(timeframe_collection,0), 0, 2)
min1=SUBSTR (get_collection_item(timeframe_collection,0), 2, 2)
hour2=SUBSTR (get_collection_item(timeframe_collection,1), 0, 2)
min2=SUBSTR (get_collection_item(timeframe_collection,1), 2, 2)
chislo=0
if (((timeframe&"")<>"") or ((timeframe&"")<>"day"))

if ((hour1+0)=(hour2+0))
if (min1-min2)=1
timeframe=1
chislo=1
end if
if (min1-min2)=2
timeframe=2
chislo=1
end if
if (min1-min2)=3
timeframe=3
chislo=1
end if
if (min1-min2)=4
timeframe=4
chislo=1
end if
if (min1-min2)=5
timeframe=5
chislo=1
end if
if (min1-min2)=6
timeframe=6
chislo=1
end if
if (min1-min2)=10
timeframe=10
chislo=1
end if
if (min1-min2)=15
timeframe=15
chislo=1
end if
if (min1-min2)=20
timeframe=20
chislo=1
end if
if (min1-min2)=30
timeframe=30
chislo=1
end if

end if

if ((hour1+0)<>(hour2+0))

if (hour1-hour2)=1
timeframe=60
chislo=1
end if

if (hour1-hour2)=2
timeframe=120
chislo=1
end if

if (hour1-hour2)=4
timeframe=240
chislo=1
end if

end if


end if


hour1=SUBSTR (get_collection_item(timeframe_collection,0), 0, 2)
min1=SUBSTR (get_collection_item(timeframe_collection,0), 2, 2)
hour2=SUBSTR (get_collection_item(timeframe_collection,1), 0, 2)
min2=SUBSTR (get_collection_item(timeframe_collection,1), 2, 2)
day_temp=0

'if (timeframe&""=="day")
'timeframe="week"
' for i from 0 to get_collection_count(dateframe_collection)-1
' z=get_collection_item(dateframe_collection,i)
' t=SUBSTR(get_collection_item(dateframe_collection,i), 6, 2)
' if (i+0)>0
' if abs(t-day_temp)==1
' timeframe="day"
' break
' end if
' end if

' day_temp=SUBSTR (get_collection_item(dateframe_collection,i), 6, 2)
' end for

'end if


time=get_datetime()
hour=get_value(time,"HOUR")
min=get_value(time,"MIN")
day=get_value(time,"DAY")
correct_day=day
month=get_value(time,"MONTH")
year=get_value(time,"YEAR")
cur_date=year*10000+month*100+day
cur_time=hour*10000+min*100

LOW_col=CREATE_COLLECTION()
HIGH_col=CREATE_COLLECTION()
open_col=CREATE_COLLECTION()
CLOSE_col=CREATE_COLLECTION()
time_col=CREATE_COLLECTION()
date_col=CREATE_COLLECTION()
cur_time_bar=get_value(get_candle(id,cur_date,cur_time,0),"time")


if ((cur_time_bar&"")!="")
cur_time_bar_pred=cur_time_bar
else
cur_time_bar=cur_time_bar_pred
end if
f=0

if (cur_time_bar+0)!=0
low_col=INSERT_COLLECTION_ITEM(low_col,0,get_value(get_candle(id,cur_date,cur_time_bar,0),"low"))
high_col=INSERT_COLLECTION_ITEM(high_col,0,get_value(get_candle(id,cur_date,cur_time_bar,0),"high"))
open_col=INSERT_COLLECTION_ITEM(open_col,0,get_value(get_candle(id,cur_date,cur_time_bar,0),"open"))
close_col=INSERT_COLLECTION_ITEM(close_col,0,get_value(get_candle(id,cur_date,cur_time_bar,0),"close"))
time_col=INSERT_COLLECTION_ITEM(time_col,0,cur_time_bar)
date_col=INSERT_COLLECTION_ITEM(date_col,0,cur_date)
f=1
end if


find_date=cur_date
point=0


if (chislo+0)==1


for i from 1 to 2000
temp3=ceil(cur_time_bar/10000)
temp4=cur_time_bar/10000

if temp3=temp4

if floor(cur_time_bar/10000)=cur_time_bar/10000

if timeframe=1
cur_time_bar=ceil(cur_time_bar/10000-1)*10000+5900
end if
if timeframe=2
cur_time_bar=ceil(cur_time_bar/10000-1)*10000+5800
end if
if timeframe=3
cur_time_bar=ceil(cur_time_bar/10000-1)*10000+5700
end if
if timeframe=4
cur_time_bar=ceil(cur_time_bar/10000-1)*10000+5600
end if
if timeframe=5
cur_time_bar=ceil(cur_time_bar/10000-1)*10000+5500
end if
if timeframe=6
cur_time_bar=ceil(cur_time_bar/10000-1)*10000+4800
end if
if timeframe=10
cur_time_bar=ceil(cur_time_bar/10000-1)*10000+5000
end if
if timeframe=15
cur_time_bar=ceil(cur_time_bar/10000-1)*10000+4500
end if
if timeframe=20
cur_time_bar=ceil(cur_time_bar/10000-1)*10000+4000
end if
if timeframe=30
cur_time_bar=ceil(cur_time_bar/10000-1)*10000+3000
end if
if timeframe=60
cur_time_bar=ceil(cur_time_bar/10000-1)*10000
end if
if timeframe=120
cur_time_bar=ceil(cur_time_bar/10000-2)*10000
end if
if timeframe=240
cur_time_bar=ceil(cur_time_bar/10000-4)*10000
end if

end if
else
cur_time_bar=cur_time_bar-timeframe*100
end if




if timeframe<60
if cur_time_bar<100000

if (market&"")="micex" and (class&""!="RTSST")
if timeframe=1
cur_time_bar=184400
end if
if timeframe=2
cur_time_bar=184400
end if
if timeframe=3
cur_time_bar=184200
end if
if timeframe=4
cur_time_bar=184400
end if
if timeframe=5
cur_time_bar=184000
end if
if timeframe=6
cur_time_bar=184200
end if
if timeframe=10
cur_time_bar=184000
end if
if timeframe=15
cur_time_bar=183000
end if
if timeframe=20
cur_time_bar=184000
end if
if timeframe=30
cur_time_bar=183000
end if
end if


if (market&"")="forts" or (class&""=="RTSST")
if timeframe=1
cur_time_bar=234900
end if
if timeframe=2
cur_time_bar=234800
end if
if timeframe=3
cur_time_bar=234800
end if
if timeframe=4
cur_time_bar=234800
end if
if timeframe=5
cur_time_bar=234500
end if
if timeframe=6
cur_time_bar=234800
end if
if timeframe=10
cur_time_bar=234000
end if
if timeframe=15
cur_time_bar=234500
end if
if timeframe=20
cur_time_bar=234000
end if
if timeframe=30
cur_time_bar=233000
end if
end if

if timeframe>50

if cur_time_bar=100000
break
end if


if cur_time_bar<100000

if timeframe=60
cur_time_bar=230000
end if

if timeframe=120
cur_time_bar=220000
end if

if timeframe=240
cur_time_bar=200000
end if

end if

end if


usl=0

for j from 1 to 15

if (day+0)<2
month=month-1
day=32
if month=0
month=12
year=year-1
end if
end if

day=day-1



cur_date=year*10000+month*100+day

slice_day = Get_Candle_Ex(id, cur_date, 103000)
LineCount_day=Get_Value(slice_day,"COUNT") +0

if (usl+0)=0
if LineCount_day>0
find_date=cur_date
usl=1
break
end if
end if
end for

end if
end if



if timeframe>59
if cur_time_bar<80000

if (market&"")="forts"

if timeframe=60
cur_time_bar=230000
end if

if timeframe=120
cur_time_bar=220000
end if

if timeframe=240
cur_time_bar=200000
end if

end if

if (market&"")="micex"

if timeframe=60
cur_time_bar=180000
end if

if timeframe=120
cur_time_bar=180000
end if

if timeframe=240
cur_time_bar=160000
end if

end if


usl=0

for j from 1 to 15

if (day+0)<2
month=month-1
day=32
if month=0
month=12
year=year-1
end if
end if

day=day-1

curdate=year*10000+month*100+day
slice_day = Get_Candle_Ex(id, curdate, 103000)
LineCount_day=Get_Value(slice_day,"COUNT") +0
if (usl+0)=0
if LineCOUNT_day>0
find_date=curdate
usl=1
break
end if
end if
end for

end if
end if

slice = Get_Candle_Ex(id, find_date,cur_time_bar)
LineCount=Get_Value(slice,"COUNT") +0
time=Get_Value(slice,"TIME")
lines=Get_Value(slice,"LINES")



if f<200
if LineCount>0
if ((cur_time_bar+0)<>0)
LineCount=Get_Value(slice,"COUNT")
time=Get_Value(slice,"TIME")
lines=Get_Value(slice,"LINES")
line=Get_Collection_Item(lines, 0)

low=Get_Value(line,"LOW")
high=Get_Value(line,"HIGH")
open=Get_Value(line,"OPEN")
close=Get_Value(line,"CLOSE")
line_name =Get_Value(line,"NAME")
volume=Get_Value(line,"VOLUME")

' if (sdelka+0)==59826 or (sdelka+0)==13034 or (sdelka+0)==3745
low_col=INSERT_COLLECTION_ITEM(low_col,f,low)
high_col=INSERT_COLLECTION_ITEM(high_col,f,high)
open_col=INSERT_COLLECTION_ITEM(open_col,f,open)
close_col=INSERT_COLLECTION_ITEM(close_col,f,close)
time_col=INSERT_COLLECTION_ITEM(time_col,f,cur_time_bar)
date_col=INSERT_COLLECTION_ITEM(date_col,f,find_date)
' end if

f=f+1
end if
end if
else
break
end if

end for
end if

prices=create_map()
prices=SET_VALUE(prices,"days",dateframe_collection)
prices=SET_VALUE(prices,"timeframe",timeframe)
prices=SET_VALUE(prices,"high",high_col)
prices=SET_VALUE(prices,"low",low_col)
prices=SET_VALUE(prices,"close",close_col)
prices=SET_VALUE(prices,"open",open_col)
prices=SET_VALUE(prices,"time",time_col)
prices=SET_VALUE(prices,"date",date_col)
result=prices
else
result=0
end if
end func



'---------------ПОЛЬЗОВАТЕЛЬСКИЙ МОДУЛЬ!!!!---------------------------------------------


'--------------Код клиента и счет депо(в случае FORTS меняем только поле client)--------

client="7655jer"
depo="7655jer"

'--------------Код клиента и счет депо(в случае FORTS меняем только поле client---------


'--------------Идентификатор на графике ------------------------------------------------

code_emi="SiZ7"
code_sar="SAR"

'--------------Идентификатор на графике ------------------------------------------------



'--------------Код ценной бумаги--------------------------------------------------------

code="SiZ7"

'--------------Код ценной бумаги--------------------------------------------------------

'---------------Проскальзывание---------------------------------------------------------

slip=300

'---------------Проскальзывание---------------------------------------------------------

'---------------Количество лотов--------------------------------------------------------

quant=5

'---------------Количество лотов--------------------------------------------------------

'---------------Выбор режима торговли---------------------------------------------------
rejim="revers"
'rejim="long"
'rejim="short"
'---------------Выбор режима торговли---------------------------------------------------






'---------------КОНЕЦ!!!!!!!!!!!!-------------------------------------------------------


new_global("trigger",1)
new_global("diff",0)
new_global("cur_min",1000000)
new_global("total_net_pred",0)
new_global("cur_max",0)
new_global("send_trans",0)
new_global("take_order",1)
new_global("long", 0)
new_global("bar_ex", 0)
new_global("trans_id", 1)
new_global("bar_enter", 0)
new_global("position", 0)
class=""
if (class&"")!="RTSS"
class=get_class(code)
end if
market=get_market(class)

SEC_PRICE_STEP=get_value(get_param_ex(class, code, "SEC_PRICE_STEP"),"PARAM_VALUE")+0
koef=1
SecInfo = GET_SECURITY_INFO(class,code)
Lot = GET_VALUE (SecInfo, "LOT_SIZE")
TOTAL_NET=get_total_net(market,client,code)

if market&""="micex"
lot =get_value(get_param_ex(class, code, "LOTSIZE"),"PARAM_VALUE")+0
total_net=0+total_net/lot
end if

line=0
string=create_map()
delete_all_items()
last= GET_PARAM (class, code , "LAST")
bid = GET_PARAM (class, code , "BID")
offer = GET_PARAM (class, code , "OFFER")


permission=time()

if (permission+0)==1




prices=create_map()
prices=get_prices(code_emi,market)
error=0
low_col=get_value(prices,"low")
high_col=get_value(prices,"high")
open_col=get_value(prices,"open")
close_col=get_value(prices,"close")
time_col=get_value(prices,"time")
date_col=get_value(prices,"date")

k_bar=get_collection_item(time_col,0)

sar_candle=get_value(get_candle(code_sar,get_collection_item(date_col,1),get_collection_item(time_col,1),0),"close")
sar_candle_pred=get_value(get_candle(code_sar,get_collection_item(date_col,2),get_collection_item(time_col,2),0),"close")

close_pred=get_collection_item(close_col,2)
close_cur=get_collection_item(close_col,1)

enter_quantity=0
exit_quantity=0

if (bar_ex+0)<(k_bar+0)

if rejim=="revers"
enter_quantity=quant-total_net
exit_quantity=total_net+quant
end if

if rejim=="long"
enter_quantity=quant-total_net
exit_quantity=total_net
end if


if rejim=="short"
enter_quantity=-total_net
exit_quantity=quant+total_net
end if


if (total_net+0)<=0
if (close_pred+0)<(sar_candle_pred+0)
if (close_cur+0)>(sar_candle+0) and (enter_quantity+0)!=0

operation(client,depo,"b",last+slip,enter_quantity,code,class,market)
message("ПОКУПКА",1)
bar_ex=k_bar

end if
end if
end if


if (total_net+0)>=0
if (close_pred+0)>(sar_candle_pred+0)
if (close_cur+0)<(sar_candle+0) and (exit_quantity+0)!=0

operation(client,depo,"s",last-slip,exit_quantity,code,class,market)
message("ПРОДАЖА",1)
bar_ex=k_bar

end if
end if
end if

end if



string=set_value(string, "ins", code)
string=set_value(string, "bid",bid)
string=set_value(string, "offer",offer)
string=set_value(string, "last",last)
string=set_value(string, "sar",sar_candle)
string=set_value(string, "close",close_pred)
string=set_value(string, "sar(-1)",sar_candle_pred)
string=set_value(string, "timeframe",get_value(prices,"timeframe"))
line=line+1
add_item(line, string)

end if


string=set_value(string, "ins", "")
string=set_value(string, "bid","")
string=set_value(string, "offer","")
string=set_value(string, "bid","")
string=set_value(string, "offer","")
string=set_value(string, "last","")
string=set_value(string, "sar","")
string=set_value(string, "close","")
string=set_value(string, "sar(-1)","")
string=set_value(string, "timeframe","")

line=line+1
add_item(line, string)

string=set_value(string, "ins", "Остаток "&code)
string=set_value(string, "bid",TOTAL_NET)

line=line+1
add_item(line, string)
Последний раз редактировалось Руба 11 дек 2017, 15:42, всего редактировалось 1 раз.
Аватара пользователя
Руба
 
Сообщения: 21
Зарегистрирован: 05 окт 2015, 11:46

Re: Параболик 1.0

Сообщение Руба » 11 дек 2017, 15:40

В кружочке показано, что он пытался продать, но не продавал, а только сообщение присылал, выше уже моя ручная заявка. А настройки взял из формулы скрипта в квике
Аватара пользователя
Руба
 
Сообщения: 21
Зарегистрирован: 05 окт 2015, 11:46

Re: Параболик 1.0

Сообщение Евгений Черных » 11 дек 2017, 15:43

Что написано в конце файла Qpile)trans.log В папке с роботом
Все бесплатные роботы тут https://vk.com/board98605354
Аватара пользователя
Евгений Черных
Администратор
 
Сообщения: 7370
Зарегистрирован: 01 ноя 2013, 12:11

Re: Параболик 1.0

Сообщение Руба » 11 дек 2017, 15:44

11.12.2017 18:01:02.618: Result: 1, Result_ex: 4, OrderNum: 0, Description: Ошибка создания заявки. [GW][332] "Нехватка средств по лимитам клиента.".
11.12.2017 18:01:17.439: Result: 1, Result_ex: 4, OrderNum: 0, Description: Ошибка создания заявки. [GW][332] "Нехватка средств по лимитам клиента.".
При этом у меня хватает средств на ту же самую сделку вручную
Аватара пользователя
Руба
 
Сообщения: 21
Зарегистрирован: 05 окт 2015, 11:46

Re: Параболик 1.0

Сообщение Евгений Черных » 11 дек 2017, 15:47

Поставьте Quant=1 и задайте робота вновь
Все бесплатные роботы тут https://vk.com/board98605354
Аватара пользователя
Евгений Черных
Администратор
 
Сообщения: 7370
Зарегистрирован: 01 ноя 2013, 12:11

Re: Параболик 1.0

Сообщение Марс » 21 фев 2018, 10:53

Добрый день. Все настроил, параболик1 запустил, не входит в лонг, вот экран.
У вас нет необходимых прав для просмотра вложений в этом сообщении.
Аватара пользователя
Марс
 
Сообщения: 33
Зарегистрирован: 13 фев 2018, 18:19

Re: Параболик 1.0

Сообщение Евгений Черных » 21 фев 2018, 11:41

Здравствуйте!
А вы робота запустили ДО или ПОСЛЕ пересечения?
Все бесплатные роботы тут https://vk.com/board98605354
Аватара пользователя
Евгений Черных
Администратор
 
Сообщения: 7370
Зарегистрирован: 01 ноя 2013, 12:11

Re: Параболик 1.0

Сообщение Марс » 21 фев 2018, 11:59

до.
Аватара пользователя
Марс
 
Сообщения: 33
Зарегистрирован: 13 фев 2018, 18:19

Re: Параболик 1.0

Сообщение Евгений Черных » 21 фев 2018, 12:05

Пришлите список сообщений Квика
Все бесплатные роботы тут https://vk.com/board98605354
Аватара пользователя
Евгений Черных
Администратор
 
Сообщения: 7370
Зарегистрирован: 01 ноя 2013, 12:11

Пред.След.

Вернуться в Бесплатные торговые роботы для QUIK

Кто сейчас на конференции

Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 2

cron