NexusTrade guide

Ultra Bullish Tech Momentum with TQQQ

Buy TQQQ when the stock is relatively high and sell when it is relatively low

Rule summary

  1. Buy 100% of the available cash in TQQQ whenever TQQQ's 50-day average price is at or above its 200-day average price and days since the last filled buy order of TQQQ is above 14 and days since the last filled buy order of TQQQ is above 3.

    Buy TQQQ 50 Day TQQQ SMA ≥ 200 Day TQQQ SMA and # of Days Since the Last Filled Buy Order of TQQQ > Constant 14 and # of Days Since the Last Filled Buy Order of TQQQ > Constant 3

  2. Sell 100% of the portfolio worth of TQQQ whenever TQQQ's 50-day average price is at or below its 200-day average price and days since the last filled buy order of TQQQ is above 14 and days since the last filled sell order of TQQQ is above 3.

    Sell 100% TQQQ 50 Day TQQQ SMA ≤ 200 Day TQQQ SMA and # of Days Since the Last Filled Buy Order of TQQQ > Constant 14 and # of Days Since the Last Filled Sell Order of TQQQ > Constant 3

What this recipe does

Buy TQQQ when the stock is relatively high and sell when it is relatively low

Exact strategy rules

These are the library's actual rule definitions. Conditions, assets, position sizing and order actions are shown together so the strategy can be inspected before it is copied.

json
[
  {
    "_id": "6aca3436b0137be4feaadebe",
    "name": "Buy 100% of the available cash in TQQQ whenever TQQQ's 50-day average price is at or above its 200-day average price and days since the last filled buy order of TQQQ is above 14 and days since the last filled buy order of TQQQ is above 3.",
    "userId": null,
    "active": true,
    "condition": {
      "name": "50 Day TQQQ SMA ≥ 200 Day TQQQ SMA and # of Days Since the Last Filled Buy Order of TQQQ > Constant 14 and # of Days Since the Last Filled Buy Order of TQQQ > Constant 3",
      "_id": "6aca34368c83c17cfcfedb87",
      "type": "And",
      "description": "All conditions must be true",
      "example": "If Apple's price is up today but down for the week.",
      "conditions": [
        {
          "lhs": {
            "compound": false,
            "targetAsset": {
              "name": "TQQQ",
              "type": "Stock",
              "symbol": "TQQQ"
            },
            "targetAssets": [],
            "window": {
              "length": 50,
              "interval": "Day"
            },
            "form": {
              "fields": [
                {
                  "fields": [
                    {
                      "helperText": "Ticker name (ex. SPY, BTC)",
                      "name": "targetAsset.symbol",
                      "label": "Asset Name",
                      "required": false,
                      "fieldType": "text",
                      "value": "TQQQ"
                    },
                    {
                      "helperText": "Ticker type (ex. Stock, Crypto)",
                      "name": "targetAsset.type",
                      "label": "Asset Type",
                      "required": false,
                      "fieldType": "select",
                      "values": [
                        "Stock",
                        "Cryptocurrency"
                      ],
                      "value": "Stock"
                    }
                  ],
                  "multiple": false,
                  "deletable": false
                },
                {
                  "fields": [
                    {
                      "helperText": "Length of time",
                      "name": "window.length",
                      "label": "Time Length",
                      "required": true,
                      "fieldType": "number",
                      "value": 50,
                      "min": 1,
                      "max": 710,
                      "globalMin": 1,
                      "globalMax": 10000,
                      "isInteger": true
                    },
                    {
                      "helperText": "Unit of time",
                      "name": "window.interval",
                      "label": "Time Unit",
                      "required": true,
                      "fieldType": "select",
                      "values": [
                        "Day",
                        "Hour",
                        "Minute"
                      ],
                      "value": "Day"
                    }
                  ],
                  "multiple": false,
                  "deletable": false
                }
              ]
            },
            "type": "SimpleMovingAverage",
            "name": "50 Day TQQQ SMA"
          },
          "rhs": {
            "compound": false,
            "targetAsset": {
              "name": "TQQQ",
              "type": "Stock",
              "symbol": "TQQQ"
            },
            "targetAssets": [],
            "window": {
              "length": 200,
              "interval": "Day"
            },
            "form": {
              "fields": [
                {
                  "fields": [
                    {
                      "helperText": "Ticker name (ex. SPY, BTC)",
                      "name": "targetAsset.symbol",
                      "label": "Asset Name",
                      "required": false,
                      "fieldType": "text",
                      "value": "TQQQ"
                    },
                    {
                      "helperText": "Ticker type (ex. Stock, Crypto)",
                      "name": "targetAsset.type",
                      "label": "Asset Type",
                      "required": false,
                      "fieldType": "select",
                      "values": [
                        "Stock",
                        "Cryptocurrency"
                      ],
                      "value": "Stock"
                    }
                  ],
                  "multiple": false,
                  "deletable": false
                },
                {
                  "fields": [
                    {
                      "helperText": "Length of time",
                      "name": "window.length",
                      "label": "Time Length",
                      "required": true,
                      "fieldType": "number",
                      "value": 200,
                      "min": 1,
                      "max": 710,
                      "globalMin": 1,
                      "globalMax": 10000,
                      "isInteger": true
                    },
                    {
                      "helperText": "Unit of time",
                      "name": "window.interval",
                      "label": "Time Unit",
                      "required": true,
                      "fieldType": "select",
                      "values": [
                        "Day",
                        "Hour",
                        "Minute"
                      ],
                      "value": "Day"
                    }
                  ],
                  "multiple": false,
                  "deletable": false
                }
              ]
            },
            "type": "SimpleMovingAverage",
            "name": "200 Day TQQQ SMA"
          },
          "name": "50 Day TQQQ SMA ≥ 200 Day TQQQ SMA",
          "_id": "6aca3436ab396f8f439010ba",
          "comparison": "greaterThanOrEqual",
          "type": "Base",
          "description": "Left-Hand indicator (comparator) Right-Hand Indicator",
          "example": "If the Rate of Change of Apple's price is > the Value 0."
        },
        {
          "lhs": {
            "compound": false,
            "targetAssets": [
              {
                "name": "TQQQ",
                "type": "Stock",
                "symbol": "TQQQ"
              }
            ],
            "side": "Buy",
            "form": {
              "fields": [
                {
                  "fields": [
                    {
                      "helperText": "Matches order events with this side (buy or sell)",
                      "name": "side",
                      "label": "Order side",
                      "required": true,
                      "fieldType": "select",
                      "values": [
                        "Buy",
                        "Sell"
                      ],
                      "value": "Buy"
                    }
                  ],
                  "multiple": false,
                  "deletable": false
                },
                {
                  "fields": [
                    {
                      "helperText": "Matches order events with this status",
                      "name": "orderStatus",
                      "label": "Order Status",
                      "required": true,
                      "fieldType": "select",
                      "values": [
                        "Pending",
                        "Accepted",
                        "Pending User Approval",
                        "Canceled",
                        "Filled",
                        "Partially Filled"
                      ],
                      "value": "Filled"
                    }
                  ],
                  "multiple": false,
                  "deletable": false
                },
                {
                  "fields": [
                    {
                      "helperText": "Ticker name (ex. SPY, BTC)",
                      "name": "targetAssets.name",
                      "label": "Asset Name",
                      "required": false,
                      "fieldType": "text",
                      "value": "TQQQ"
                    },
                    {
                      "helperText": "Ticker type (ex. Stock, Crypto)",
                      "name": "targetAssets.type",
                      "label": "Asset Type",
                      "required": false,
                      "fieldType": "select",
                      "values": [
                        "Stock",
                        "Cryptocurrency"
                      ],
                      "value": "Stock"
                    }
                  ],
                  "multiple": true,
                  "deletable": false
                }
              ]
            },
            "type": "DaysSinceOrder",
            "orderStatus": "Filled",
            "name": "# of Days Since the Last Filled Buy Order of TQQQ"
          },
          "rhs": {
            "compound": false,
            "targetAssets": [],
            "value": 14,
            "form": {
              "fields": [
                {
                  "fields": [
                    {
                      "helperText": "Constant value",
                      "name": "value",
                      "label": "Value",
                      "required": true,
                      "fieldType": "number",
                      "value": 14,
                      "min": -100,
                      "max": 100,
                      "globalMin": -1000000,
                      "globalMax": 1000000,
                      "isInteger": false
                    }
                  ],
                  "multiple": false,
                  "deletable": false
                }
              ]
            },
            "type": "Value",
            "name": "Constant 14"
          },
          "name": "# of Days Since the Last Filled Buy Order of TQQQ > Constant 14",
          "_id": "6aca34363c274cdeb3916faa",
          "comparison": "greaterThan",
          "type": "Base",
          "description": "Left-Hand indicator (comparator) Right-Hand Indicator",
          "example": "If the Rate of Change of Apple's price is > the Value 0."
        },
        {
          "lhs": {
            "compound": false,
            "targetAssets": [
              {
                "name": "TQQQ",
                "type": "Stock",
                "symbol": "TQQQ"
              }
            ],
            "side": "Buy",
            "form": {
              "fields": [
                {
                  "fields": [
                    {
                      "helperText": "Matches order events with this side (buy or sell)",
                      "name": "side",
                      "label": "Order side",
                      "required": true,
                      "fieldType": "select",
                      "values": [
                        "Buy",
                        "Sell"
                      ],
                      "value": "Buy"
                    }
                  ],
                  "multiple": false,
                  "deletable": false
                },
                {
                  "fields": [
                    {
                      "helperText": "Matches order events with this status",
                      "name": "orderStatus",
                      "label": "Order Status",
                      "required": true,
                      "fieldType": "select",
                      "values": [
                        "Pending",
                        "Accepted",
                        "Pending User Approval",
                        "Canceled",
                        "Filled",
                        "Partially Filled"
                      ],
                      "value": "Filled"
                    }
                  ],
                  "multiple": false,
                  "deletable": false
                },
                {
                  "fields": [
                    {
                      "helperText": "Ticker name (ex. SPY, BTC)",
                      "name": "targetAssets.name",
                      "label": "Asset Name",
                      "required": false,
                      "fieldType": "text",
                      "value": "TQQQ"
                    },
                    {
                      "helperText": "Ticker type (ex. Stock, Crypto)",
                      "name": "targetAssets.type",
                      "label": "Asset Type",
                      "required": false,
                      "fieldType": "select",
                      "values": [
                        "Stock",
                        "Cryptocurrency"
                      ],
                      "value": "Stock"
                    }
                  ],
                  "multiple": true,
                  "deletable": false
                }
              ]
            },
            "type": "DaysSinceOrder",
            "orderStatus": "Filled",
            "name": "# of Days Since the Last Filled Buy Order of TQQQ"
          },
          "rhs": {
            "compound": false,
            "targetAssets": [],
            "value": 3,
            "form": {
              "fields": [
                {
                  "fields": [
                    {
                      "helperText": "Constant value",
                      "name": "value",
                      "label": "Value",
                      "required": true,
                      "fieldType": "number",
                      "value": 3,
                      "min": -100,
                      "max": 100,
                      "globalMin": -1000000,
                      "globalMax": 1000000,
                      "isInteger": false
                    }
                  ],
                  "multiple": false,
                  "deletable": false
                }
              ]
            },
            "type": "Value",
            "name": "Constant 3"
          },
          "name": "# of Days Since the Last Filled Buy Order of TQQQ > Constant 3",
          "_id": "6aca34362828b2ce61f8e8d2",
          "comparison": "greaterThan",
          "type": "Base",
          "description": "Left-Hand indicator (comparator) Right-Hand Indicator",
          "example": "If the Rate of Change of Apple's price is > the Value 0."
        }
      ]
    },
    "createdAt": "2026-10-10T12:48:54.717Z",
    "action": {
      "type": "Buy",
      "targetAsset": {
        "name": "TQQQ",
        "type": "Stock",
        "symbol": "TQQQ"
      },
      "amount": {
        "type": "percent of buying power",
        "amount": 100
      }
    },
    "orderExecution": {
      "type": "Market"
    },
    "automaticOrderApproval": false
  },
  {
    "_id": "6aca3436b0137be4feaadec0",
    "name": "Sell 100% of the portfolio worth of TQQQ whenever TQQQ's 50-day average price is at or below its 200-day average price and days since the last filled buy order of TQQQ is above 14 and days since the last filled sell order of TQQQ is above 3.",
    "userId": null,
    "active": true,
    "condition": {
      "name": "50 Day TQQQ SMA ≤ 200 Day TQQQ SMA and # of Days Since the Last Filled Buy Order of TQQQ > Constant 14 and # of Days Since the Last Filled Sell Order of TQQQ > Constant 3",
      "_id": "6aca34361875e9c2cf67b055",
      "type": "And",
      "description": "All conditions must be true",
      "example": "If Apple's price is up today but down for the week.",
      "conditions": [
        {
          "lhs": {
            "compound": false,
            "targetAsset": {
              "name": "TQQQ",
              "type": "Stock",
              "symbol": "TQQQ"
            },
            "targetAssets": [],
            "window": {
              "length": 50,
              "interval": "Day"
            },
            "form": {
              "fields": [
                {
                  "fields": [
                    {
                      "helperText": "Ticker name (ex. SPY, BTC)",
                      "name": "targetAsset.symbol",
                      "label": "Asset Name",
                      "required": false,
                      "fieldType": "text",
                      "value": "TQQQ"
                    },
                    {
                      "helperText": "Ticker type (ex. Stock, Crypto)",
                      "name": "targetAsset.type",
                      "label": "Asset Type",
                      "required": false,
                      "fieldType": "select",
                      "values": [
                        "Stock",
                        "Cryptocurrency"
                      ],
                      "value": "Stock"
                    }
                  ],
                  "multiple": false,
                  "deletable": false
                },
                {
                  "fields": [
                    {
                      "helperText": "Length of time",
                      "name": "window.length",
                      "label": "Time Length",
                      "required": true,
                      "fieldType": "number",
                      "value": 50,
                      "min": 1,
                      "max": 710,
                      "globalMin": 1,
                      "globalMax": 10000,
                      "isInteger": true
                    },
                    {
                      "helperText": "Unit of time",
                      "name": "window.interval",
                      "label": "Time Unit",
                      "required": true,
                      "fieldType": "select",
                      "values": [
                        "Day",
                        "Hour",
                        "Minute"
                      ],
                      "value": "Day"
                    }
                  ],
                  "multiple": false,
                  "deletable": false
                }
              ]
            },
            "type": "SimpleMovingAverage",
            "name": "50 Day TQQQ SMA"
          },
          "rhs": {
            "compound": false,
            "targetAsset": {
              "name": "TQQQ",
              "type": "Stock",
              "symbol": "TQQQ"
            },
            "targetAssets": [],
            "window": {
              "length": 200,
              "interval": "Day"
            },
            "form": {
              "fields": [
                {
                  "fields": [
                    {
                      "helperText": "Ticker name (ex. SPY, BTC)",
                      "name": "targetAsset.symbol",
                      "label": "Asset Name",
                      "required": false,
                      "fieldType": "text",
                      "value": "TQQQ"
                    },
                    {
                      "helperText": "Ticker type (ex. Stock, Crypto)",
                      "name": "targetAsset.type",
                      "label": "Asset Type",
                      "required": false,
                      "fieldType": "select",
                      "values": [
                        "Stock",
                        "Cryptocurrency"
                      ],
                      "value": "Stock"
                    }
                  ],
                  "multiple": false,
                  "deletable": false
                },
                {
                  "fields": [
                    {
                      "helperText": "Length of time",
                      "name": "window.length",
                      "label": "Time Length",
                      "required": true,
                      "fieldType": "number",
                      "value": 200,
                      "min": 1,
                      "max": 710,
                      "globalMin": 1,
                      "globalMax": 10000,
                      "isInteger": true
                    },
                    {
                      "helperText": "Unit of time",
                      "name": "window.interval",
                      "label": "Time Unit",
                      "required": true,
                      "fieldType": "select",
                      "values": [
                        "Day",
                        "Hour",
                        "Minute"
                      ],
                      "value": "Day"
                    }
                  ],
                  "multiple": false,
                  "deletable": false
                }
              ]
            },
            "type": "SimpleMovingAverage",
            "name": "200 Day TQQQ SMA"
          },
          "name": "50 Day TQQQ SMA ≤ 200 Day TQQQ SMA",
          "_id": "6aca34364598738d66228568",
          "comparison": "lessThanOrEqual",
          "type": "Base",
          "description": "Left-Hand indicator (comparator) Right-Hand Indicator",
          "example": "If the Rate of Change of Apple's price is > the Value 0."
        },
        {
          "lhs": {
            "compound": false,
            "targetAssets": [
              {
                "name": "TQQQ",
                "type": "Stock",
                "symbol": "TQQQ"
              }
            ],
            "side": "Buy",
            "form": {
              "fields": [
                {
                  "fields": [
                    {
                      "helperText": "Matches order events with this side (buy or sell)",
                      "name": "side",
                      "label": "Order side",
                      "required": true,
                      "fieldType": "select",
                      "values": [
                        "Buy",
                        "Sell"
                      ],
                      "value": "Buy"
                    }
                  ],
                  "multiple": false,
                  "deletable": false
                },
                {
                  "fields": [
                    {
                      "helperText": "Matches order events with this status",
                      "name": "orderStatus",
                      "label": "Order Status",
                      "required": true,
                      "fieldType": "select",
                      "values": [
                        "Pending",
                        "Accepted",
                        "Pending User Approval",
                        "Canceled",
                        "Filled",
                        "Partially Filled"
                      ],
                      "value": "Filled"
                    }
                  ],
                  "multiple": false,
                  "deletable": false
                },
                {
                  "fields": [
                    {
                      "helperText": "Ticker name (ex. SPY, BTC)",
                      "name": "targetAssets.name",
                      "label": "Asset Name",
                      "required": false,
                      "fieldType": "text",
                      "value": "TQQQ"
                    },
                    {
                      "helperText": "Ticker type (ex. Stock, Crypto)",
                      "name": "targetAssets.type",
                      "label": "Asset Type",
                      "required": false,
                      "fieldType": "select",
                      "values": [
                        "Stock",
                        "Cryptocurrency"
                      ],
                      "value": "Stock"
                    }
                  ],
                  "multiple": true,
                  "deletable": false
                }
              ]
            },
            "type": "DaysSinceOrder",
            "orderStatus": "Filled",
            "name": "# of Days Since the Last Filled Buy Order of TQQQ"
          },
          "rhs": {
            "compound": false,
            "targetAssets": [],
            "value": 14,
            "form": {
              "fields": [
                {
                  "fields": [
                    {
                      "helperText": "Constant value",
                      "name": "value",
                      "label": "Value",
                      "required": true,
                      "fieldType": "number",
                      "value": 14,
                      "min": -100,
                      "max": 100,
                      "globalMin": -1000000,
                      "globalMax": 1000000,
                      "isInteger": false
                    }
                  ],
                  "multiple": false,
                  "deletable": false
                }
              ]
            },
            "type": "Value",
            "name": "Constant 14"
          },
          "name": "# of Days Since the Last Filled Buy Order of TQQQ > Constant 14",
          "_id": "6aca3436e90de663f798da1a",
          "comparison": "greaterThan",
          "type": "Base",
          "description": "Left-Hand indicator (comparator) Right-Hand Indicator",
          "example": "If the Rate of Change of Apple's price is > the Value 0."
        },
        {
          "lhs": {
            "compound": false,
            "targetAssets": [
              {
                "name": "TQQQ",
                "type": "Stock",
                "symbol": "TQQQ"
              }
            ],
            "side": "Sell",
            "form": {
              "fields": [
                {
                  "fields": [
                    {
                      "helperText": "Matches order events with this side (buy or sell)",
                      "name": "side",
                      "label": "Order side",
                      "required": true,
                      "fieldType": "select",
                      "values": [
                        "Buy",
                        "Sell"
                      ],
                      "value": "Sell"
                    }
                  ],
                  "multiple": false,
                  "deletable": false
                },
                {
                  "fields": [
                    {
                      "helperText": "Matches order events with this status",
                      "name": "orderStatus",
                      "label": "Order Status",
                      "required": true,
                      "fieldType": "select",
                      "values": [
                        "Pending",
                        "Accepted",
                        "Pending User Approval",
                        "Canceled",
                        "Filled",
                        "Partially Filled"
                      ],
                      "value": "Filled"
                    }
                  ],
                  "multiple": false,
                  "deletable": false
                },
                {
                  "fields": [
                    {
                      "helperText": "Ticker name (ex. SPY, BTC)",
                      "name": "targetAssets.name",
                      "label": "Asset Name",
                      "required": false,
                      "fieldType": "text",
                      "value": "TQQQ"
                    },
                    {
                      "helperText": "Ticker type (ex. Stock, Crypto)",
                      "name": "targetAssets.type",
                      "label": "Asset Type",
                      "required": false,
                      "fieldType": "select",
                      "values": [
                        "Stock",
                        "Cryptocurrency"
                      ],
                      "value": "Stock"
                    }
                  ],
                  "multiple": true,
                  "deletable": false
                }
              ]
            },
            "type": "DaysSinceOrder",
            "orderStatus": "Filled",
            "name": "# of Days Since the Last Filled Sell Order of TQQQ"
          },
          "rhs": {
            "compound": false,
            "targetAssets": [],
            "value": 3,
            "form": {
              "fields": [
                {
                  "fields": [
                    {
                      "helperText": "Constant value",
                      "name": "value",
                      "label": "Value",
                      "required": true,
                      "fieldType": "number",
                      "value": 3,
                      "min": -100,
                      "max": 100,
                      "globalMin": -1000000,
                      "globalMax": 1000000,
                      "isInteger": false
                    }
                  ],
                  "multiple": false,
                  "deletable": false
                }
              ]
            },
            "type": "Value",
            "name": "Constant 3"
          },
          "name": "# of Days Since the Last Filled Sell Order of TQQQ > Constant 3",
          "_id": "6aca343695eba691abc96eb5",
          "comparison": "greaterThan",
          "type": "Base",
          "description": "Left-Hand indicator (comparator) Right-Hand Indicator",
          "example": "If the Rate of Change of Apple's price is > the Value 0."
        }
      ]
    },
    "createdAt": "2026-10-10T12:48:54.718Z",
    "action": {
      "type": "Sell",
      "targetAsset": {
        "name": "TQQQ",
        "type": "Stock",
        "symbol": "TQQQ"
      },
      "amount": {
        "type": "percent of portfolio",
        "amount": 100
      }
    },
    "orderExecution": {
      "type": "Market"
    },
    "automaticOrderApproval": false
  }
]

Before testing

Open the library, find this recipe by its title and preview the rules. Choose Use template for a built-in entry, or Add to portfolio for a saved entry. Review the copied rules and customize their thresholds and allocations before testing. Choose a historical period and starting capital in the portfolio backtester. Check trade count, drawdown, costs and a benchmark before enabling a paper portfolio. A recipe is a configuration, not a performance result.

A completed test should show the selected period, orders and portfolio statistics. If it records no trades, inspect the entry conditions and selected assets before loosening rules. If market data is missing or the run fails, keep the error and fix the coverage issue before comparing results. Changing a threshold or allocation changes the strategy. Keep the original definition and compare changes on a separate period rather than selecting settings from one favorable result.