Skip to content

Instantly share code, notes, and snippets.

//@version=2
// author: Milad Doorbash
strategy("Bitfinex Greed Level + RSI Strategy")
sym = input(title="Symbol", defval="BTCUSD", type=string)
greedChange = input(0.4, title="Greed Change")
greedLength = input(100, title="Greed SMA Length")
rsiHigh = input(70, title="RSI High")
rsiLow = input(30, title="RSI Low")
//@version=4
study("Weighted SMA")
weighted_sma(price, length) =>
totalWeight = log(length)
totalMA = log(length) * price
for i = 1 to length-1
totalWeight := totalWeight + log(length - i)
currentMA = log(length - i) * sma(price, i)
totalMA := totalMA + currentMA
totalMA / totalWeight
package io.colyseus.example.java;
import io.colyseus.Client;
import io.colyseus.Room;
import kotlin.Unit;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.CoroutineContext;
import org.jetbrains.annotations.NotNull;
public class Main {
import kotlin.reflect.jvm.jvmErasure
import kotlin.reflect.typeOf
class Y
class X<T>
@OptIn(ExperimentalStdlibApi::class)
inline fun <reified T> T.getGenericType(): Class<Any>? = typeOf<T>().arguments[0].type?.jvmErasure?.java as Class<Any>?
import { Client } from ".";
const client = new Client("ws://localhost:2560");
(async () => {
try {
const room = await client.joinOrCreate<any>("ffa");
console.log("joined successfully", room.sessionId);
package main
import (
"fmt"
"net/http"
"time"
"github.com/dghubble/go-twitter/twitter"
"github.com/dghubble/oauth1"
)
package main
import (
"bytes"
"errors"
"fmt"
"log"
"net"
"os"
"os/signal"
package main
import (
"fmt"
"log"
"net/http"
"os/exec"
)
func metrics(w http.ResponseWriter, req *http.Request) {
targets:
- google.com
dns:
refresh: 2m15s
nameserver: 1.1.1.1
ping:
interval: 10s
timeout: 3s
global:
resolve_timeout: 5m
route:
group_by: ['alertname']
group_wait: 30s
group_interval: 10m
repeat_interval: 4h
receiver: 'web.hook'
receivers: