NexusTrade guide

Google (GOOG) Moving Average Crossover

Try to sell Google when the stock is relatively high and buy when it is relatively low

Rule summary

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

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

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

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

What this recipe does

Try to sell Google when the stock is relatively high and buy 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": "6aca33d57473bd0006ad0505",
    "name": "Buy 100% of the available cash in GOOG whenever GOOG's 50-day average price is at or above its 200-day average price and days since the last filled buy order of GOOG is above 14 and days since the last filled buy order of GOOG is above 3.",
    "userId": null,
    "active": true,
    "condition": {
      "name": "50 Day GOOG SMA ≥ 200 Day GOOG SMA and # of Days Since the Last Filled Buy Order of GOOG > Constant 14 and # of Days Since the Last Filled Buy Order of GOOG > Constant 3",
      "_id": "6aca33d508ecb3b5831ec2a0",
      "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": "GOOG",
              "type": "Stock",
              "symbol": "GOOG"
            },
            "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": "GOOG"
                    },
                    {
                      "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 GOOG SMA"
          },
          "rhs": {
            "compound": false,
            "targetAsset": {
              "name": "GOOG",
              "type": "Stock",
              "symbol": "GOOG"
            },
            "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": "GOOG"
                    },
                    {
                      "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 GOOG SMA"
          },
          "name": "50 Day GOOG SMA ≥ 200 Day GOOG SMA",
          "_id": "6aca33d5ffc3af80cee0ab34",
          "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": "GOOG",
                "type": "Stock",
                "symbol": "GOOG"
              }
            ],
            "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": "GOOG"
                    },
                    {
                      "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 GOOG"
          },
          "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 GOOG > Constant 14",
          "_id": "6aca33d5c501bb500a33b1d0",
          "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": "GOOG",
                "type": "Stock",
                "symbol": "GOOG"
              }
            ],
            "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": "GOOG"
                    },
                    {
                      "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 GOOG"
          },
          "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 GOOG > Constant 3",
          "_id": "6aca33d5e8cb8db989f78ff4",
          "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:47:17.559Z",
    "action": {
      "type": "Buy",
      "targetAsset": {
        "name": "GOOG",
        "type": "Stock",
        "symbol": "GOOG"
      },
      "amount": {
        "type": "percent of buying power",
        "amount": 100
      }
    },
    "orderExecution": {
      "type": "Market"
    },
    "automaticOrderApproval": false
  },
  {
    "_id": "6aca33d57473bd0006ad0507",
    "name": "Sell 100% of the portfolio worth of GOOG whenever GOOG's 50-day average price is at or below its 200-day average price and days since the last filled buy order of GOOG is above 14 and days since the last filled sell order of GOOG is above 3.",
    "userId": null,
    "active": true,
    "condition": {
      "name": "50 Day GOOG SMA ≤ 200 Day GOOG SMA and # of Days Since the Last Filled Buy Order of GOOG > Constant 14 and # of Days Since the Last Filled Sell Order of GOOG > Constant 3",
      "_id": "6aca33d557cfa9bd0239fef4",
      "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": "GOOG",
              "type": "Stock",
              "symbol": "GOOG"
            },
            "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": "GOOG"
                    },
                    {
                      "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 GOOG SMA"
          },
          "rhs": {
            "compound": false,
            "targetAsset": {
              "name": "GOOG",
              "type": "Stock",
              "symbol": "GOOG"
            },
            "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": "GOOG"
                    },
                    {
                      "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 GOOG SMA"
          },
          "name": "50 Day GOOG SMA ≤ 200 Day GOOG SMA",
          "_id": "6aca33d53d2c55cfc44e09c6",
          "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": "GOOG",
                "type": "Stock",
                "symbol": "GOOG"
              }
            ],
            "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": "GOOG"
                    },
                    {
                      "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 GOOG"
          },
          "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 GOOG > Constant 14",
          "_id": "6aca33d549318cc55b8dcd97",
          "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": "GOOG",
                "type": "Stock",
                "symbol": "GOOG"
              }
            ],
            "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": "GOOG"
                    },
                    {
                      "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 GOOG"
          },
          "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 GOOG > Constant 3",
          "_id": "6aca33d5719377f922e05113",
          "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:47:17.560Z",
    "action": {
      "type": "Sell",
      "targetAsset": {
        "name": "GOOG",
        "type": "Stock",
        "symbol": "GOOG"
      },
      "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.