Пример #1
0
    def as_json(self):
        _, ts1, ts2 = self.calculate()

        return ([{
            'name': 'STOCH-K',
            'series': common.pd2json(ts2),
            'position': 2,
        }, {
            'name': 'STOCH-D',
            'series': common.pd2json(ts1),
            'position': 2,
        }], self.config())
Пример #2
0
 def as_json(self):
   _, ts1, ts2 = self.calculate()
   
   return ( [{ 
     'name'   : 'STOCH-K',
     'series' : common.pd2json(ts2),
     'position' : 2,
    },{ 
     'name'   : 'STOCH-D',
     'series' : common.pd2json(ts1),
     'position' : 2,
    }], self.config() )
Пример #3
0
 def as_json(self):
   _, ts = self.calculate()
   return ( [{ 
     'name'      : 'ZigZag(%d)' % self.cutoff(),
     'series'    : common.pd2json(ts),
     'position'  : 0,
   }], self.config() )
Пример #4
0
    def as_json(self):
        _, ts1 = self.calculate()

        return (
            [{"name": "%s(%d)" % (self.func, self.timeperiod), "series": common.pd2json(ts1), "position": 2}],
            self.config(),
        )
Пример #5
0
 def as_json(self):
     _, ts = self.calculate()
     return ([{
         'name': 'ZigZag(%d)' % self.cutoff(),
         'series': common.pd2json(ts),
         'position': 0,
     }], self.config())
Пример #6
0
 def as_json(self):
   ts = self.calculate()
   return ( [{
     'series'    : [],
     'flags'     : { 'sr' : common.pd2json(ts) },
     'position'  : 0,
   }], self.config() )
Пример #7
0
 def as_json(self):
   _, ts1, ts2, ts3 = self.calculate()
   
   flags = self.applyFlags(ts1, ts2)
   
   return ( [{ 
     'name'   : 'MACD-H%d' % self.signalperiod,
     'series' : common.pd2json(ts3),
     'type'   : 'column'
   }, {
     'name'   : 'MACD',
     'series' : common.pd2json(ts1),
     'flags'  : flags
   }, {
     'name'   : 'MACD-Signal',
     'series' : common.pd2json(ts2)
   }], self.config() )
Пример #8
0
    def as_json(self):
        _, ts1, ts2, ts3 = self.calculate()

        flags = self.applyFlags(ts1, ts2)

        return ([{
            'name': 'MACD-H%d' % self.signalperiod,
            'series': common.pd2json(ts3),
            'type': 'column'
        }, {
            'name': 'MACD',
            'series': common.pd2json(ts1),
            'flags': flags
        }, {
            'name': 'MACD-Signal',
            'series': common.pd2json(ts2)
        }], self.config())
Пример #9
0
 def as_json(self):
     _, ts = self.calculate()
     flags = self.applyFlags(ts)
     return ([{
         'name': 'CCI-%d' % self.timeperiod(),
         'series': common.pd2json(ts),
         'flags': flags,
     }], self.__class__.options(self.options))
Пример #10
0
 def as_json(self):
   _, ts1 = self.calculate()
   
   return ( [{ 
     'name'   : self.func,
     'series' : common.pd2json(ts1),
     'position' : 0,
    }], self.config() )
Пример #11
0
    def as_json(self):
        _, ts1 = self.calculate()

        return ([{
            'name': "%s(%d)" % (self.func, self.timeperiod),
            'series': common.pd2json(ts1),
            'position': 2
        }], self.config())
Пример #12
0
 def as_json(self):
   _, ts = self.calculate()
   flags = self.applyFlags(ts)
   return ( [{ 
     'name'   : 'CCI-%d' % self.timeperiod(),
     'series' : common.pd2json(ts),
     'flags'  : flags,
   }], self.__class__.options( self.options) )
Пример #13
0
    def as_json(self):
        _, ts1 = self.calculate()

        return ([{
            'name': self.func,
            'series': common.pd2json(ts1),
            'position': 0
        }], self.config())
Пример #14
0
 def as_json(self):
   _, ts = self.calculate()
   flags = self.applyFlags(ts)
   return ( [{ 
     'name'   : 'RSI(%d)' % self.timeperiod(),
     'series' : common.pd2json(ts),
     'flags'  : flags,
     'position' : 2
   }], self.config() )
Пример #15
0
    def as_json(self):
        _, ts1 = self.calculate()
        flags = common.pd2json(self.applyFlags(ts1))

        return ([{
            'name': self.func,
            'series': flags,
            'position': 0
        }], self.config())
Пример #16
0
 def as_json(self):
     ts = self.calculate()
     return ([{
         'series': [],
         'flags': {
             'sr': common.pd2json(ts)
         },
         'position': 0,
     }], self.config())
Пример #17
0
 def as_json(self):
     _, ts = self.calculate()
     flags = self.applyFlags(ts)
     return ([{
         'name': 'RSI(%d)' % self.timeperiod(),
         'series': common.pd2json(ts),
         'flags': flags,
         'position': 2
     }], self.config())
Пример #18
0
 def as_json(self):
   _, ts1 = self.calculate()
   flags =  common.pd2json( self.applyFlags(ts1) )
   
   return ( [{ 
     'name'   : self.func,
     'series' : flags,
     'position' : 0
    }], self.config() )
Пример #19
0
 def as_json(self):
   _, ts1, ts2, ts3 = self.calculate()
   
   flags = self.applyFlags(ts1, ts3)
   return ( [{ 
     'name'   : 'BBANDS-UP',
     'series' : common.pd2json(ts1),
     'flags'  : { 'overbought': common.pd2json( flags.get('overbought', []) ) } ,
     'position' : 0
   }, {
     'name'   : 'BBANDS-SMA',
     'series' : common.pd2json(ts2),
     'position' : 0
   }, {
     'name'   : 'BBANDS-DW',
     'series' : common.pd2json(ts3),
     'flags'  : { 'oversold': common.pd2json( flags.get('oversold', []) ) },
     'position' : 0
   }], self.config() )
Пример #20
0
    def as_json(self):
        _, ts1, ts2, ts3 = self.calculate()

        flags = self.applyFlags(ts1, ts3)
        return ([{
            'name': 'BBANDS-UP',
            'series': common.pd2json(ts1),
            'flags': {
                'overbought': common.pd2json(flags.get('overbought', []))
            },
            'position': 0
        }, {
            'name': 'BBANDS-SMA',
            'series': common.pd2json(ts2),
            'position': 0
        }, {
            'name': 'BBANDS-DW',
            'series': common.pd2json(ts3),
            'flags': {
                'oversold': common.pd2json(flags.get('oversold', []))
            },
            'position': 0
        }], self.config())