How to use the hikyuu.util.unicode.unicodeFunc function in hikyuu

To help you get started, we’ve selected a few hikyuu examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github fasiondog / hikyuu / hikyuu / data_driver / data_driver.py View on Github external
from ._data_driver import (DataDriverFactory,
                           BaseInfoDriver,
                           BlockInfoDriver,
                           KDataDriver)
from hikyuu.util.unicode import (unicodeFunc, reprFunc)


BaseInfoDriver.__unicode__ = unicodeFunc
BaseInfoDriver.__repr__ = reprFunc

BlockInfoDriver.__unicode__ = unicodeFunc
BlockInfoDriver.__repr__ = reprFunc

KDataDriver.__unicode__ = unicodeFunc
KDataDriver.__repr__ = reprFunc
github fasiondog / hikyuu / tools / hikyuu / indicator / indicator.py View on Github external
from ._indicator import *
from hikyuu.util.slice import list_getitem
from hikyuu.util.unicode import (IS_PY3, unicodeFunc, reprFunc)
from hikyuu import constant, toPriceList, PriceList


def indicator_iter(indicator):
    for i in range(len(indicator)):
        yield indicator[i]
        

Indicator.__getitem__ = list_getitem
Indicator.__iter__ = indicator_iter


Indicator.__unicode__ =  unicodeFunc
Indicator.__repr__ =  reprFunc 

Indicator.__add__ = indicator_add
Indicator.__sub__ = indicator_sub
Indicator.__mul__ = indicator_mul
Indicator.__div__ = indicator_div
Indicator.__truediv__ = indicator_div #Python3 div
Indicator.__eq__ = indicator_eq
Indicator.__ne__ = indicator_ne
Indicator.__ge__ = indicator_ge
Indicator.__le__ = indicator_le
Indicator.__gt__ = indicator_gt
Indicator.__lt__ = indicator_lt
Indicator.__and__ = IND_AND
Indicator.__or__ = IND_OR
github fasiondog / hikyuu / hikyuu / trade_sys / portfolio.py View on Github external
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.


from ._trade_sys import (Portfolio, PF_Simple)
from hikyuu.util.unicode import (unicodeFunc, reprFunc)

Portfolio.__unicode__ = unicodeFunc
Portfolio.__repr__ = reprFunc


#------------------------------------------------------------------
# add doc-string
#------------------------------------------------------------------

Portfolio.__doc__ = """实现多标的、多策略的投资组合"""

Portfolio.name.__doc__ = """名称"""

Portfolio.tm.__doc__ = """关联的交易管理实例"""

Portfolio.se.__doc__ = """选择器策略"""

Portfolio.run.__doc__ = """
github fasiondog / hikyuu / tools / hikyuu / data_driver / data_driver.py View on Github external
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.



from ._data_driver import (DataDriverFactory,
                           BaseInfoDriver,
                           BlockInfoDriver,
                           KDataDriver)
from hikyuu.util.unicode import (unicodeFunc, reprFunc)


BaseInfoDriver.__unicode__ = unicodeFunc
BaseInfoDriver.__repr__ = reprFunc

BlockInfoDriver.__unicode__ = unicodeFunc
BlockInfoDriver.__repr__ = reprFunc

KDataDriver.__unicode__ = unicodeFunc
KDataDriver.__repr__ = reprFunc
github fasiondog / hikyuu / tools / hikyuu / data_driver / data_driver.py View on Github external
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.



from ._data_driver import (DataDriverFactory,
                           BaseInfoDriver,
                           BlockInfoDriver,
                           KDataDriver)
from hikyuu.util.unicode import (unicodeFunc, reprFunc)


BaseInfoDriver.__unicode__ = unicodeFunc
BaseInfoDriver.__repr__ = reprFunc

BlockInfoDriver.__unicode__ = unicodeFunc
BlockInfoDriver.__repr__ = reprFunc

KDataDriver.__unicode__ = unicodeFunc
KDataDriver.__repr__ = reprFunc
github fasiondog / hikyuu / hikyuu / trade_manage / trade.py View on Github external
from ._trade_manage import *
from hikyuu import Datetime, Query, QueryByDate, StockManager
from hikyuu.util.slice import list_getitem
from hikyuu.util.unicode import (unicodeFunc, reprFunc)
from hikyuu.trade_sys.system import getSystemPartName

BUSINESS.INIT = BUSINESS.BUSINESS_INIT
BUSINESS.BUY = BUSINESS.BUSINESS_BUY
BUSINESS.SELL = BUSINESS.BUSINESS_SELL
BUSINESS.GIFT = BUSINESS.BUSINESS_GIFT
BUSINESS.BONUS = BUSINESS.BUSINESS_BONUS
BUSINESS.CHECKIN = BUSINESS.BUSINESS_CHECKIN
BUSINESS.CHECKOUT = BUSINESS.BUSINESS_CHECKOUT
BUSINESS.INVALID = BUSINESS.INVALID_BUSINESS

TradeManager.__unicode__ = unicodeFunc
TradeManager.__repr__ = reprFunc
CostRecord.__unicode__ = unicodeFunc
CostRecord.__repr__ = reprFunc
TradeRecord.__unicode__ = unicodeFunc
TradeRecord.__repr__ = reprFunc
PositionRecord.__unicode__ = unicodeFunc
PositionRecord.__repr__ = reprFunc
TradeCostBase.__unicode__ = unicodeFunc
TradeCostBase.__repr__ = reprFunc
FundsRecord.__unicode__ = unicodeFunc
FundsRecord.__repr__ = reprFunc
BorrowRecord.__unicode__ = unicodeFunc
BorrowRecord.__repr__ = reprFunc
OrderBrokerBase.__unicode__ = unicodeFunc
OrderBrokerBase.__repr__ = reprFunc
github fasiondog / hikyuu / hikyuu / data_driver / data_driver.py View on Github external
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.



from ._data_driver import (DataDriverFactory,
                           BaseInfoDriver,
                           BlockInfoDriver,
                           KDataDriver)
from hikyuu.util.unicode import (unicodeFunc, reprFunc)


BaseInfoDriver.__unicode__ = unicodeFunc
BaseInfoDriver.__repr__ = reprFunc

BlockInfoDriver.__unicode__ = unicodeFunc
BlockInfoDriver.__repr__ = reprFunc

KDataDriver.__unicode__ = unicodeFunc
KDataDriver.__repr__ = reprFunc
github fasiondog / hikyuu / hikyuu / data_driver / data_driver.py View on Github external
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.



from ._data_driver import (DataDriverFactory,
                           BaseInfoDriver,
                           BlockInfoDriver,
                           KDataDriver)
from hikyuu.util.unicode import (unicodeFunc, reprFunc)


BaseInfoDriver.__unicode__ = unicodeFunc
BaseInfoDriver.__repr__ = reprFunc

BlockInfoDriver.__unicode__ = unicodeFunc
BlockInfoDriver.__repr__ = reprFunc

KDataDriver.__unicode__ = unicodeFunc
KDataDriver.__repr__ = reprFunc
github fasiondog / hikyuu / tools / hikyuu / trade_sys / portfolio.py View on Github external
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.


from ._trade_sys import (Portfolio, PF_Simple)
from hikyuu.util.unicode import (unicodeFunc, reprFunc)

Portfolio.__unicode__ = unicodeFunc
Portfolio.__repr__ = reprFunc


#------------------------------------------------------------------
# add doc-string
#------------------------------------------------------------------

Portfolio.__doc__ = """实现多标的、多策略的投资组合"""

Portfolio.name.__doc__ = """名称"""

Portfolio.tm.__doc__ = """关联的交易管理实例"""

Portfolio.se.__doc__ = """选择器策略"""

Portfolio.run.__doc__ = """
github fasiondog / hikyuu / tools / hikyuu / trade_sys / allocatefunds.py View on Github external
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.


from ._trade_sys import (AllocateFundsBase,
                         SystemWeight,
                         SystemWeightList, 
                         AF_EqualWeight)
from hikyuu.util.unicode import (unicodeFunc, reprFunc)
from hikyuu.util.slice import list_getitem

AllocateFundsBase.__unicode__ = unicodeFunc
AllocateFundsBase.__repr__ = reprFunc

SystemWeight.__unicode__ = unicodeFunc
SystemWeight.__repr = reprFunc

SystemWeightList.__getitem__ = list_getitem