Skip to content

Instantly share code, notes, and snippets.

View davassi's full-sized avatar
🐙
Rust

Gianluigi Davassi davassi

🐙
Rust
View GitHub Profile

Here’s a ready-to-paste “super-prompt” you can give to an AI to generate a Pine Script v6 strategy exactly as you described. It’s explicit, opinionated, and designed to trade rarely and only when the odds are stacked in one direction.


Prompt to Generate Pine v6 Strategy (High-Confidence, Factor-Inspired, Low-Frequency)

You are an expert Pine Script v6 quant developer. Write a Pine Script v6 strategy (not study) that trades infrequently and only under strong directional evidence. The system must:

  • Go LONG only when multiple bullish conditions are all confirmed and no bearish or uncertain conditions are present.
Here’s a ready-to-paste “super-prompt” you can give to an AI to generate a **Pine Script v6** strategy exactly as you described. It’s explicit, opinionated, and designed to trade **rarely** and **only** when the odds are stacked in one direction.
---
# Prompt to Generate Pine v6 Strategy (High-Confidence, Factor-Inspired, Low-Frequency)
You are an expert Pine Script v6 quant developer.
Write a **Pine Script v6 strategy** (not study) that trades **infrequently** and **only** under **strong** directional evidence. The system must:
* **Go LONG only** when **multiple bullish conditions** are all confirmed and **no bearish or uncertain conditions** are present.
@davassi
davassi / rust
Created October 2, 2023 06:44
calc
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release
use eframe::egui;
use egui::{Vec2, Rounding, TextEdit, FontId, FontSelection, FontFamily, Separator, Button};
use yarer::session::Session;
use egui::TextStyle::*;
macro_rules! butt {
($t:expr) => {
Button::new($t).min_size(Vec2::new(64.,64.)).rounding(Rounding::same(4.)).frame(false)
use std::{rc::Rc, cell::RefCell, fmt::Display};
type Pointer<T> = Option<Rc<RefCell<Node<T>>>>;
struct Node<T> {
data: T,
next : Pointer<T>,
prev : Pointer<T>,
}
@davassi
davassi / ll.rs
Last active September 24, 2023 14:05
A double linked list
use std::{rc::Rc, cell::RefCell, fmt::Display};
type Pointer<T> = Option<Rc<RefCell<Node<T>>>>;
struct Node<T> {
data: T,
next : Pointer<T>,
prev : Pointer<T>,
}
@davassi
davassi / keybase.md
Last active November 13, 2020 09:09

Keybase proof

I hereby claim:

  • I am davassi on github.
  • I am exquisitus (https://keybase.io/exquisitus) on keybase.
  • I have a public key ASAT9FWXWTJ0L2lXS61p_tVHhq0wr8F6AyJIY4HBsXPAdwo

To claim this, I am signing this object:

0x5B25EEb8d63cca4671E191e787fbC837a442D443
private void findAllUnconfirmedTransactions() {
synchronized (StorageScratchpad.instance().getAnalyzedTransactionsFlags()) {
// get the hash of the last milestone.
final Hash milestone = Milestone.getHashOfLastMilestoneIndex();
if (milestone != null) {
// get the trunk transaction hash
long pointer = StorageTransactions.instance().transactionPointer(milestone.bytes());
final Transaction transaction = StorageTransactions.instance().loadTransaction(pointer);
@davassi
davassi / bt.java
Last active October 20, 2016 20:34
binary truth table
private static final int not(int a) {
return a^0b1;
}
//https://s16.postimg.org/dthtvw3id/binary_curl.png
private static int rt(int a, int b, int c, int d) {
return ((a ^ d) & (not(b) | c));
}
private static int lt(int a, int b, int c, int d) {
/*
* Calculate distance between two points in latitude and longitude taking
* into account height difference. If you are not interested in height
* difference pass 0.0. Uses Haversine method as its base.
*
* lat1, lon1 Start point lat2, lon2 End point el1 Start altitude in meters
* el2 End altitude in meters
*/
public double distanceKm(double lat1, double lat2, double lon1, double lon2,
double el1, double el2) {