Position: Home page » Virtual » Python virtual currency K line

Python virtual currency K line

Publish: 2021-05-13 18:19:59
1. The full name of BHT is bit hot token, which is a new coin launched by the currency exchange. It was launched on November 3, 2018. What is new coin? BHT can be used to buy other mainstream currencies, such as BTC, and high-quality tokens of the project side. First, you can go to the coin good platform to buy the mainstream coins and high-quality tokens launched in the activities; Second, you can hold this in your hand and wait for the price to rise before you sell it on the platform. The price increase comes from the decrease of quantity, and the price is higher. It's more expensive to have a few things. Because of the operation of repurchasing and destroying, the quantity in circulation in the market will be reced, the overall value will remain unchanged, and the price will rise.
2. Python digital currency quantitative trading advanced course, has been learned, generally mastered.
3. Candlestick charts are also known as candle chart, Japanese line, Yin Yang line, stick line, red and black line, etc. they are commonly referred to as "K line". It is based on the opening price, the highest price, the lowest price and the closing price of each analysis cycle
the graphic state can be divided into reverse form, finishing form, gap and trend line. Post-K line chart is introced into the stock market and futures market because of its exquisite and unique way of marking. The drawing method of K-line chart in stock market and futures market includes four data, namely opening price, highest price, lowest price and closing price. All k-lines are around these four data to reflect the general situation and price information. If you put the daily K-line chart on a piece of paper, you can get the daily K-line chart, as well as weekly K-line chart and monthly K-line chart
basically, every trading platform has a K-line chart, Xigu digital asset trading platform has a K-line chart of Ruitai coin, and Qianjin card trading platform has a K-line chart of Qianjin card.
4.

F5 is the switch key between the real-time trend chart and the K-line. After you select a stock, press F5 to switch to the daily K-line chart. Then right click the mouse: right - forward right. The K-line reflects the real trend of stock price. Press and hold the left direction key, the K-line graph will run continuously to the right, and the previous historical K-line will be displayed. If you want to view the K-line of a long time ago, you can continuously press the down direction key to make the K-line diagram smaller, and then move the mouse on the K-line, and the date will be displayed on the K-line diagram. You can quickly find the K line you need, and then press the up direction key to enlarge the K line, you can see more clearly. The following figure shows the K line of PetroChina on April 28, 2015

5.
6. All cryptocurrencies are written in C / C + +, Python is too slow, only for algorithm.
7.

#coding:utf-8

import random

def mntb(T):

a = 0

b = 0

while a < T and b < T:

num = random.randint(0,1)

#print num 这里你可以看到每次抛的硬币的正反面情况

if num == 0:

a += 1

else:

b += 1

if a == T:

print u'b的得分是:%d '%b

return 'a won'

if b == T:

print u'a的得分是:%d '%a

return 'b won'


#你执行这个函数就可以了,T代表你设置的分数 mntb(T),代码写的比较啰嗦 嘿嘿

按照你题目的意思要这样修改一下:看题大意了,并不是从0开始统计

#coding:utf-8

import random

def mntb(T,a,b):#a代表p1目前的分数 b代表p2目前的分数

while a < T and b < T:

num = random.randint(0,1)

#print num 这里你可以看到每次抛的硬币的正反面情况

if num == 0:

a += 1

else:

b += 1

if a == T:

print u'p2的得分是:%d '%b

return 'p1 won'

if b == T:

print u'p1的得分是:%d '%a

return 'p2 won'


#你执行这个函数就可以了,T代表你设置的分数 mntb(T,a,b)

8.

Idea: suppose there is an array arr, in which the int value represents the weight of silver coins, and the subscript represents the number of silver coins

loop (non recursive): assign the first value of the array to the variable TMP, loop from the second variable to the last, compare the variable in the loop with the TMP value, if not, return the decimal subscript

recursion: with the idea of dichotomy, silver coins are divided into two piles (if it can't be equally divided, leave the middle one), and take the pile with small weight to continue dichotomy. When there is only one left, it is the desired

. The following writing method returns the subscript. You can also assume that the coin is a data type, and then return that type

< pre t = "code" L = "Python" >/ usr/bin/python
#-*- coding:utf-8- *-

? Returns the minimum subscript
defgetmin (Arr1):
iflen (Arr1) = = 0: Return-1

TMP = Arr1 [0]
index = 0
forcurnarr1:
iftmp= cur:
return0iftmp< curelseindex
index+=1
return-1

real_ Index = 0
# return minimum subscript recursion
defgetminrecursion (Arr1):
global real_ index
n=len(arr1)
ifn==0:return-1

ifn==1:returnreal_ index
ifn==2:returnreal_ indexifarr1[0]< arr1[1]elsereal_ index+1

sum1=sum(arr1[0:int(n/3)])
sum2=sum(arr1[int(n/3):int(n/3)*2])

ifsum1==sum2:
real_ index+=int(n/3)*2
returngetMinRecursion(arr1[int(n/3)*2:n+1])
ifsum1< sum2:
returngetMinRecursion(arr1[0:int(n/3)])
else:
real_ index+=int(n/3)
returngetMinRecursion(arr1[int(n/3):int(n/3)*2])

arr=[1,1,1,1,1,1,0,1,1]
print("% d"% getMin(arr))
print("% d"% getMinRecursion(arr))
9. package TanXin;

/ * money change problem * /
/ * this problem is more common in our daily life. Suppose there are C0, C1, C2, C3, C4, C5 and C6 banknotes of 1 yuan, 2 yuan, 5 yuan, 10 yuan, 20 yuan, 50 yuan and 100 yuan respectively. How many banknotes will it take to pay K yuan with the money? With the idea of greedy algorithm, it is obvious that every step can be done with banknotes of large denomination. We naturally do the same thing in our daily life. In the program, the values have been arranged from small to large in advance*/
public class qianbizhaoling {
public static void main (string [] args) {
/ / RMB face value set
int [] values = {1, 2, 5, 10, 20, 50, 100}
/ / corresponding quantity set of various face values
int [] counts = {3, 1, 2, 1, 1, 3, 5}
/ / how many denominations are required for RMB 442?
int [] num = change (442, values, counts);
int< br /> print(num, values);
}

public static int [] change (int money, int [] values, int [] counts) {
/ / used to record the number of various denominations needed
int [] result = New Int [values. Length]< br />
for (int i = values.length - 1; i >= 0; i--) {
int num = 0;
/ / the maximum face value of RMB is required
int c = min (money / values [i], counts [i])
/ / the amount of money left
money = money - C * values [i]
/ / save the number of RMB sheets with the maximum face value in the array
num + = C< br /> result[i] = num;< br /> }
return result;
}

/ *
* returns the minimum value
* /
private static int min (int i, int j) {
return I & gt; j ? j : i;< br /> }

private static void print(int[] num, int[] values) {
for (int i = 0; i < values.length; i++) {
if (num[i] != 0) {
System.out.println(" The required denomination is & quot+ values[i] + " RMB & quot+ num[i] + " Zhang & quot;)< br /> }
}
}
}
10.

Total = 5000 ᦇ total 500 yuan

one_ Yuan = 10 # denomination 1 yuan

Five_ Jiao = 5 ᦇ denomination 5 jiao

one_ Jiao = 1 ᦇ denomination 1 jiao

count = 0

for I in range (total / / one)_ yuan+1):

for j in range((total - i * one_ yuan) // five_ jiao+1):

if((total - i * one_ yuan - j * five_ jiao) % one_ jiao == 0):

count+=1

#print("% d*%d+%d*%d+%d*%d=%d" %( i,one_ yuan,j,five_ jiao,(total - i * one_ yuan - j * five_ jiao) / one_ jiao,one_ Extension materials:

when Python is executing, the source code in. Py file is first compiled into Python byte code, and then the compiled byte code is executed by Python virtual machine. The basic idea of this mechanism is consistent with javanet

four spaces must be used to represent each level of indentation. The use of tab character and other number of spaces can be compiled, but it does not conform to the coding specification. Tab characters and other numbers of spaces are only supported for compatibility with very old Python programs and some problematic editing programs

Hot content
Inn digger Publish: 2021-05-29 20:04:36 Views: 341
Purchase of virtual currency in trust contract dispute Publish: 2021-05-29 20:04:33 Views: 942
Blockchain trust machine Publish: 2021-05-29 20:04:26 Views: 720
Brief introduction of ant mine Publish: 2021-05-29 20:04:25 Views: 848
Will digital currency open in November Publish: 2021-05-29 19:56:16 Views: 861
Global digital currency asset exchange Publish: 2021-05-29 19:54:29 Views: 603
Mining chip machine S11 Publish: 2021-05-29 19:54:26 Views: 945
Ethereum algorithm Sha3 Publish: 2021-05-29 19:52:40 Views: 643
Talking about blockchain is not reliable Publish: 2021-05-29 19:52:26 Views: 754
Mining machine node query Publish: 2021-05-29 19:36:37 Views: 750