Beispiel #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())
Beispiel #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() )
Beispiel #3
0
 def as_json(self):
   _, ts = self.calculate()
   return ( [{ 
     'name'      : 'ZigZag(%d)' % self.cutoff(),
     'series'    : common.pd2json(ts),
     'position'  : 0,
   }], self.config() )
Beispiel #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(),
        )
Beispiel #5
0
 def as_json(self):
     _, ts = self.calculate()
     return ([{
         'name': 'ZigZag(%d)' % self.cutoff(),
         'series': common.pd2json(ts),
         'position': 0,
     }], self.config())
Beispiel #6
0
 def as_json(self):
   ts = self.calculate()
   return ( [{
     'series'    : [],
     'flags'     : { 'sr' : common.pd2json(ts) },
     'position'  : 0,
   }], self.config() )
Beispiel #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() )
Beispiel #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())
Beispiel #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))
 def as_json(self):
   _, ts1 = self.calculate()
   
   return ( [{ 
     'name'   : self.func,
     'series' : common.pd2json(ts1),
     'position' : 0,
    }], self.config() )
Beispiel #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())
Beispiel #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) )
    def as_json(self):
        _, ts1 = self.calculate()

        return ([{
            'name': self.func,
            'series': common.pd2json(ts1),
            'position': 0
        }], self.config())
Beispiel #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() )
Beispiel #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())
Beispiel #16
0
 def as_json(self):
     ts = self.calculate()
     return ([{
         'series': [],
         'flags': {
             'sr': common.pd2json(ts)
         },
         'position': 0,
     }], self.config())
Beispiel #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())
Beispiel #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() )
Beispiel #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() )
Beispiel #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())