Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: [split] Python error
Post: [split] Python error

_gDF = pdf.DataFrame(listValue) _gDF = _gDF.transpose() _gDF.columns = listKey # plt.figure(); _gDF.plot(); # fig = plt.figure(figsize=(20,8)) # fig.add_subplo...
jazzy General Coding Help 1 2,153 Dec-20-2018, 05:57 PM
    Thread: append elements into the empty dataframe
Post: append elements into the empty dataframe

def backtest(inCapital): rCapital = inCapital qty1 = 0 hp = 0 cap=0 preAdjClose = 0 tempAdjClose = 0 columns = ['Date'] #, 'AdjClose', 'POS', 'SMA' ,'LMA'] ...
jazzy General Coding Help 0 2,106 Sep-26-2018, 07:26 AM
    Thread: python indentation errror and output error
Post: RE: python indentation errror and output error

def backtest(inCapital): ohp = 0 ocp = 0 hp = 0 cp = 0 capital = 1000 rCapital = 0 pnl = 0 pa = 0 columns = ['hp','cp', 'adj.close','pnl','capital'] df = p...
jazzy Data Science 4 3,377 Sep-19-2018, 09:35 AM
    Thread: python indentation errror and output error
Post: RE: python indentation errror and output error

pos=[] for i in range(len(data)): if pos == 0: if data[:"short_moving_avg"] > data["long_moving_avg"]: pos=-1 elif data["shor...
jazzy Data Science 4 3,377 Sep-14-2018, 05:48 AM
    Thread: python indentation errror and output error
Post: RE: python indentation errror and output error

import pandas as pd import numpy as np import matplotlib.pyplot as plt data = pd.read_csv('aapl.csv') data1 = data[['Date']] data1 = data1.set_index('Date') data = data[["Adj Close"]] data.head() ...
jazzy Data Science 4 3,377 Sep-05-2018, 06:17 AM
    Thread: python indentation errror and output error
Post: python indentation errror and output error

def backtest(parameters, price1,init_capital, max_capital_deploy, buy_margin, sell_margin): longwindow = int(parameters[0]) shortwindow = int(parameters[1]) if (longwindow < shortw...
jazzy Data Science 4 3,377 Sep-05-2018, 06:14 AM
    Thread: looping in python
Post: RE: looping in python

import pandas as pd import numpy as np def perfomance_statistics(initial_capital,pnl): max_draw_down=max_draw_down(initial_capital,pnl) # max drawdown #maxdrawdown=5000...
jazzy Data Science 12 6,345 Aug-27-2018, 11:16 AM
    Thread: looping in python
Post: RE: looping in python

I want to make a buy signal closing the previous sell signal and a sell signal closing previous buy signal can some one tell me the code below is correct or not because m nt getting signal generated s...
jazzy Data Science 12 6,345 Jul-27-2018, 10:58 AM
  Thumbs Up Thread: looping in python
Post: RE: looping in python

ok I will use the proper quote and repost it short_long_signal=[] for i, r in enumerate (aapl.iterrows()): if r[1]['a'] > r[1]['b'] and r[1]['c'] < r[1]['k1'] and r[1]['o1'] > r[1]['o2'...
jazzy Data Science 12 6,345 Jul-18-2018, 05:23 AM
    Thread: looping in python
Post: RE: looping in python

is this correct a=[] for i, r in enumerate (aapl.iterrows()): if r[1]['a'] < r[1]['b'] and r[1]['c'] > r[1]['k1'] and r[1]['o1'] > r[1]['o1']: a.append(1) buy stock while a.append(1) and r[...
jazzy Data Science 12 6,345 Jul-16-2018, 11:24 AM
    Thread: looping in python
Post: RE: looping in python

can u tell me how to make graphical interpretation using matplotlib a=[] for i, r in enumerate (aapl.iterrows()): if r[1]['a'] < r[1]['b'] and r[1]['c'] > r[1]['k1'] and r[1]['o1'] > r[...
jazzy Data Science 12 6,345 Jul-16-2018, 07:38 AM
    Thread: looping in python
Post: RE: looping in python

for i, r in enumerate (aapl.iterrows()): if r[1]['a'] < r[1]['b'] and r[1]['c'] > r[1]['k1'] and r[1]['o1'] > r[1]['o1'] : short_long_signal = 1 elif r[1]['a'] > r[1]['b'...
jazzy Data Science 12 6,345 Jul-16-2018, 05:51 AM
    Thread: looping in python
Post: looping in python

df1 df2 df3 df4 e5,e100,c .... ku,kl,kd,c ... o1,c ... o20,c e5>e100 and c<ku and o1>o10 s=1 e5<e100 and c>kd and o1<o10 s=-1 if both co...
jazzy Data Science 12 6,345 Jul-12-2018, 07:27 AM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020