Skip to content

Instantly share code, notes, and snippets.

nidkil nidkil

View GitHub Profile
@nidkil
nidkil / PT_EMA_SMA_SPREAD
Last active Jan 31, 2018
Tradeview Pinescript to visualize ProfitTrailer EMASPREAD and SMASPREAD strategy.
View PT_EMA_SMA_SPREAD
//@version=3
study(title="EMA and SMA Spread", shorttitle="EMASMASPREAD", overlay=false)
// Parameters
param_buy_value_conservative = input(0.1)
param_buy_value_moderate = input(0.5)
param_buy_value_aggresive = input(0.25)
param_ema_fast = input(5)
param_ema_slow = input(20)
param_sma_fast = input(5)
View restplus_test.py
"""
Standalone test class that sets up a basic API that supports both JSON and XML. It is a single class setup so
that it is easy to follow.
Some quick pointers:
- If a multi line docstring is present in any function, it will be displayed in the Swagger UI as
"Implementation Notes". Use the Markdown syntax to format these notes, see
https://daringfireball.net/projects/markdown/syntax.
- Namespaces allow the API operations to be split into separate files, each defining a part of the API with a
different URL prefix.
View quick_test.py
from flask import Flask, Blueprint, url_for, jsonify
from flask_restplus import Api, Resource
from flask_marshmallow import Marshmallow, base_fields
from marshmallow import post_dump
# Setup Flask app
url_prefix = '/api/v4'
doc = '/apidoc/'
app = Flask(__name__)
@nidkil
nidkil / JsonTestServlet.scala
Created Dec 2, 2014
Halt does not work with JacksonJsonSupport trait mixed in
View JsonTestServlet.scala
package com.nidkil.jsontest
import org.json4s.{Formats, DefaultFormats}
import org.scalatra._
import org.scalatra.json._
import scalate.ScalateSupport
class JsonTestServlet extends ScalatraServlet with JacksonJsonSupport {
protected implicit val jsonFormats: Formats = DefaultFormats
You can’t perform that action at this time.