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
# replace all nine occurrences of $AWSRegion in swagger.json with the region that you are creating your API and Lamdba in
$ sed -i '.bak' 's/$AWSRegion/us-east-1/g' swagger.json
# get the LambdaArn
$ aws cloudformation describe-stacks --stack-name apigateway --query Stacks[0].Outputs
# replace all nine occurrences of $LambdaArn in swagger.json with the ARN from the stack output above (e.g. arn:aws:lambda:us-east-1:YYY:function:apigateway-Lambda-XXX)
$ LambdaArn/arn:aws:lambda:us-east-1:YYY:function:apigateway-Lambda-XXX/g' swagger.json
$ 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 / create-bucket-upload-lambda.sh
Last active May 6, 2019 10:18
Create a bucket and copy the lambda.zip
$ aws s3api create-bucket - bucket $your-bucket-name - region us-east-1
$ aws s3 cp lambda.zip s3://$your-bucket-name/lambda.zip