1 from Import DataFrame 2 df = DataFrame (dictlist)3 df = df.sort_values (by= ' Internalreturn ', ascending=false)
A 122-symbol real-time risk analysis program is now being written to extract the best trading symbols and their position cycle information. Because the indicator is more, so decided to use dataframe structure.
When I use the following code to generate a new DF structure
1 df = df.sort_values (by='internalreturn', Ascending=false, Inplace=true)
The result is empty.
Alternative methods:
Df2=df.nlargest (columns='internalreturn')
You can also use
Df2=df.head (10)
Accordingly, there are also:
1 df2=df.tail (ten)2 df2=df.nsmallest (10,columns=internalreturn)
Because the main symbol is not changed frequently in practice, the short-term position change does not affect the symbol.
Spreads is actually sunk cost. There are only two kinds of varieties with low volatility spreads: almost no fluctuations or too large spreads.
Give two examples:
THB 15 minutes is 20 points, not low volatility in forex, but the Thai baht spread is 11 points, in other words even if the direction is consistent, 15 minutes yield is still more than 50% of the probability is negative.
Platinum has a 15-minute yield of over 100% and is ranked number one in metal, but spreads account for 16.5%
In the long run, the volatility spread ratio is a stable value. Some contingencies may significantly change the volatility of the spreads, such as the Turkish lira of the Turkish coup this year, the UK's Brexit pound Sterling, but after a prolonged period of time, a stable value can be obtained.
The significance of monitoring fluctuation spread ratio is to filter the short-term symbol and adjust the variety pool.
Dataframe Sorting problems