Skip to content

Instantly share code, notes, and snippets.

plt.plot(df['tenkan_sen'], label='Tenkan sen', color='cornflowerblue', linewidth = 0.5)
plt.plot(df['kijun_sen'], label='Kijun sen', color='salmon', linewidth = 0.5)
plt.plot(df['senkou_span_a'], label='Senkou span A', color='lightgreen', linewidth = 0.5)
plt.plot(df['senkou_span_b'], label='Senkou span B', color='lightcoral', linewidth = 0.5)
plt.plot(df['chikou_span'], label='Chikou span', color='green', linewidth = 1)
plt.fill_between(df.index, df['senkou_span_a'], df['senkou_span_b'], where = df['senkou_span_a'] >= df['senkou_span_b'], color = 'honeydew')
plt.fill_between(df.index, df['senkou_span_a'], df['senkou_span_b'], where = df['senkou_span_a'] < df['senkou_span_b'], color = 'mistyrose')
@croosen
croosen / ichimoku_mplfinance.py
Created August 11, 2022 13:36
Ichimoku Cloud in mplfinance
import mplfinance as mpf
ichimoku_cloud = [
mpf.make_addplot(df['tenkan_sen'], color = 'blue', width = 1),
mpf.make_addplot(df['kijun_sen'], color = 'red', width = 1),
mpf.make_addplot(df['senkou_span_a'], color = 'lightgreen', width = 0.5),
mpf.make_addplot(df['senkou_span_b'], color = 'lightcoral', width = 0.5),
mpf.make_addplot(df['chikou_span'], color = 'green', width = 1)
]
@croosen
croosen / Magento module mappings
Last active November 12, 2019 08:36
Original mappings from the Magento Code Migration Toolkit with added mappings for Magento 1.7.0.2
protected $moduleMapping = [
"Mage_Sendfriend" => "Magento_SendFriend",
"Mage_AdminNotification" => "Magento_AdminNotification",
"Mage_Authorizenet" => "Magento_Authorizenet",
"Mage_Bundle" => "Magento_Bundle",
"Mage_Captcha" => "Magento_Captcha",
"Mage_Catalog" => "Magento_Catalog",
"Mage_CatalogInventory" => "Magento_CatalogInventory",
"Mage_CatalogRule" => "Magento_CatalogRule",
"Mage_CatalogSearch" => "Magento_CatalogSearch",
# use `amplify add <feature>`
$ amplify add analytics
$ amplify push
$ npm install aws-amplify
$ npm install aws-amplify-angular
# set endpoint variable
$export ApiGatewayEndpoint="$AppId.execute-api.us-east-1.amazonaws.com/v1"
# add a new user
curl -vvv -X POST -d '{"email": "your@mail.com", "phone": "0123456789"}' -H "Content-Type: application/json" https://$ApiGatewayEndpoint/user
# list users
curl -vvv -X GET https://$ApiGatewayEndpoint/user
# import your swagger to apigateway
$ aws apigateway import-rest-api --fail-on-warnings --body file://swagger.json
# update cloudformation template
$ aws cloudformation update-stack --stack-name $your-stack-name --template-body file://template.json --capabilities CAPABILITY_IAM --parameters ParameterKey=S3Bucket,UsePreviousValue=true ParameterKey=S3Key,UsePreviousValue=true ParameterKey=ApiId,ParameterValue=$ApiId
# deploy to stage v1
$ aws apigateway create-deployment --rest-api-id $ApiId --stage-name v1
$ aws cloudformation create-stack --stack-name $your-stack-name --template-body file://template.json --capabilities CAPABILITY_IAM --parameters ParameterKey=S3Bucket,ParameterValue=$your-bucket-name
$ aws cloudformation describe-stacks --stack-name $your-stack-name --query Stacks[0].Outputs
$ aws cloudformation wait stack-create-complete
@croosen
croosen / aws-api-clone-apigateway.sh
Last active May 6, 2019 10:19
Clone the example from the multi-user ToDo application from chapter 10 in Amazon Web Services in Action.
$ git clone git@github.com:AWSinAction/apigateway.git
$ cd apigateway/
@croosen
croosen / create-lambda-zip.sh
Last active May 6, 2019 10:19
Create lambda.zip
$ npm install - production
$ ./bundle.sh