You are here: home » pinescript » demonstrations » print_logs

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

pinescript:demonstrations:print_logs [2025/02/11 21:16] – created adminpinescript:demonstrations:print_logs [2025/08/27 06:49] (current) – created derrickdivine5
Line 1: Line 1:
-====== Print Logs ======+Cannabis clones make life easier for anyone starting a garden. Every clone is a direct copy of a healthy mother plant. In other words, your grow stays uniform and  If you cherished this article and also you would like to acquire more info relating to [[https://rmcnargs.org/michigan/richmond/|clones for sale in Michigan]] nicely visit our internet site. repeatable.
  
-===== log.error() =====+People often ask where to buy cannabis clones. The answer is to check reliable sources, where growers share info about shipping, care, and genetics. Some vendors now ship clones directly to your door, without needing to hunt down a local shop.
  
-Converts the formatting string and value(s) into formatted stringand sends the result to the "Pine logs" menu tagged with the "error" debug level.+The first step with any new clone is inspection. Avoid any clones with spots, yellowing, or pests. Give it new home with lightairy substrate. Keep light low for the first days, then increase over time. This keeps stress low.
  
-The formatting string can contain literal text and one placeholder in curly braces {} for each value to be formattedEach placeholder consists of the index of the required argument (beginning at 0) that will replace it, and an optional format specifier. The index represents the position of that argument in the function's argument list. +Growers can use clones inside tents or outside in soilWith the right nutrients and environmentyou’ll see consistent buds every cycleSeeds are good for crossing and varietynothing beats clones for consistent harvests.
- +
-==== Arguments ==== +
- +
-**message (series string)** Log message. +
- +
-==== Example ==== +
- +
-<code JavaScript [enable_line_numbers="true"]> +
-//@version=6 +
-strategy("My strategy"overlay = true, process_orders_on_close = true) +
-bracketTickSizeInput = input.int(1000, "Stoploss/Take-Profit distance (in ticks)"+
- +
-longCondition = ta.crossover(ta.sma(close, 14), ta.sma(close, 28)) +
-if (longCondition) +
-    limitLevel = close * 1.01 +
-    log.info("Long limit order has been placed at {0}", limitLevel) +
-    strategy.order("My Long Entry Id", strategy.long, limit = limitLevel) +
- +
-    log.info("Exit orders have been placed: Take-profit at {0}, Stop-loss at {1}", close, limitLevel) +
-    strategy.exit("Exit", "My Long Entry Id", profit = bracketTickSizeInput, loss = bracketTickSizeInput) +
- +
-if strategy.opentrades > 10 +
-    log.warning("{0} positions opened in the same direction in a row. Try adjusting `bracketTickSizeInput`", strategy.opentrades) +
- +
-last10Perc = strategy.initial_capital / 10 > strategy.equity +
-if (last10Perc and not last10Perc[1]) +
-    log.error("The strategy has lost 90% of the initial capital!"+
-</code> +
- +
-===== log.info() ===== +
- +
-Converts the formatting string and value(s) into a formatted string, and sends the result to the "Pine logs" menu tagged with the "info" debug level. +
- +
-The formatting string can contain literal text and one placeholder in curly braces {} for each value to be formatted. Each placeholder consists of the index of the required argument (beginning at 0) that will replace it, and an optional format specifier. The index represents the position of that argument in the function's argument list. +
- +
-==== Arguments ==== +
- +
-**message (series string)** Log message. +
- +
-==== Example ==== +
- +
-<code JavaScript [enable_line_numbers="true"]> +
-//@version=6 +
-strategy("My strategy"overlay = true, process_orders_on_close = true) +
-bracketTickSizeInput = input.int(1000, "Stoploss/Take-Profit distance (in ticks)"+
- +
-longCondition = ta.crossover(ta.sma(close, 14), ta.sma(close, 28)) +
-if (longCondition) +
-    limitLevel = close * 1.01 +
-    log.info("Long limit order has been placed at {0}", limitLevel) +
-    strategy.order("My Long Entry Id", strategy.long, limit = limitLevel) +
- +
-    log.info("Exit orders have been placed: Take-profit at {0}, Stop-loss at {1}", close, limitLevel) +
-    strategy.exit("Exit", "My Long Entry Id", profit = bracketTickSizeInput, loss = bracketTickSizeInput) +
- +
-if strategy.opentrades > 10 +
-    log.warning("{0} positions opened in the same direction in a row. Try adjusting `bracketTickSizeInput`", strategy.opentrades) +
- +
-last10Perc = strategy.initial_capital / 10 > strategy.equity +
-if (last10Perc and not last10Perc[1]) +
-    log.error("The strategy has lost 90% of the initial capital!"+
- +
-</code> +
- +
-===== log.warning() ===== +
- +
-Converts the formatting string and value(s) into a formatted string, and sends the result to the "Pine logs" menu tagged with the "warning" debug level. +
- +
-The formatting string can contain literal text and one placeholder in curly braces {} for each value to be formattedEach placeholder consists of the index of the required argument (beginning at 0) that will replace it, and an optional format specifier. The index represents the position of that argument in the function's argument list. +
- +
-==== Arguments ==== +
- +
-**message (series string)** Log message. +
- +
-==== Example ==== +
- +
-<code JavaScript [enable_line_numbers="true"]> +
-//@version=6 +
-strategy("My strategy", overlay = true, process_orders_on_close = true) +
-bracketTickSizeInput = input.int(1000, "Stoploss/Take-Profit distance (in ticks)"+
- +
-longCondition = ta.crossover(ta.sma(close, 14), ta.sma(close, 28)) +
-if (longCondition) +
-    limitLevel = close * 1.01 +
-    log.info("Long limit order has been placed at {0}", limitLevel) +
-    strategy.order("My Long Entry Id", strategy.long, limit = limitLevel) +
- +
-    log.info("Exit orders have been placed: Take-profit at {0}, Stop-loss at {1}", close, limitLevel) +
-    strategy.exit("Exit", "My Long Entry Id", profit = bracketTickSizeInput, loss = bracketTickSizeInput) +
- +
-if strategy.opentrades > 10 +
-    log.warning("{0} positions opened in the same direction in a row. Try adjusting `bracketTickSizeInput`", strategy.opentrades) +
- +
-last10Perc = strategy.initial_capital / 10 > strategy.equity +
-if (last10Perc and not last10Perc[1]) +
-    log.error("The strategy has lost 90% of the initial capital!"+
- +
-</code>+
Back to top