{"id":9,"date":"2024-12-24T17:09:00","date_gmt":"2024-12-24T17:09:00","guid":{"rendered":""},"modified":"2025-06-21T15:30:04","modified_gmt":"2025-06-21T15:30:04","slug":"new-pine-scipt-martingale-strategy","status":"publish","type":"post","link":"https:\/\/kriptos.my\/index.php\/2024\/12\/24\/new-pine-scipt-martingale-strategy\/","title":{"rendered":"New Pine Scipt: Martingale Strategy"},"content":{"rendered":"<p>This script actually does not really involve any Technical Analysis (TA). It just a bot that runs on traditional martingale strategy.<\/p>\n<p>Martingale startegy is&nbsp;a risk management strategy that originated in 18th-century France. It is based on the principle of doubling down on losses to recover them in the next winning trade.<\/p>\n<p><b>Strategy description: <\/b>It places BUY order and double down (according to the multiplier) when the price got lower. TP as per your setting. This strategy works best during bearish period with recovery pattern.<\/p>\n<p><b><u>Recommended setting:<\/u><\/b><\/p>\n<p>Pair: <b>SUIUSDT (Binance)<\/b><\/p>\n<p>Time frame:&nbsp;<b>5min<\/b><\/p>\n<p>Min capital in wallet:<b>&nbsp;168 USDT<\/b>&nbsp;<\/p>\n<div class=\"separator\" style=\"clear: both; text-align: center;\"><a href=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEi2WHfCkAoDceRfRZwo3Csscy_ol6ERHECbrlWMEysoUyrl4eT9baZrwBS7CcSBPBEELkayS81YSwj5x_FNe4cG7GZBTK8Fc-cML_cSGcd2h_ACT4KcyF3VumjLcHH2ZLevXeXSkDyIqAIj6GKCBpeKKfZ5fQzrsJoM9yohykc_-BW_laFm3xcf2nquJkxW\/s1059\/Screenshot%202024-12-25%20010535.png\" style=\"margin-left: 1em; margin-right: 1em;\"><img decoding=\"async\" border=\"0\" data-original-height=\"481\" data-original-width=\"1059\" src=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEi2WHfCkAoDceRfRZwo3Csscy_ol6ERHECbrlWMEysoUyrl4eT9baZrwBS7CcSBPBEELkayS81YSwj5x_FNe4cG7GZBTK8Fc-cML_cSGcd2h_ACT4KcyF3VumjLcHH2ZLevXeXSkDyIqAIj6GKCBpeKKfZ5fQzrsJoM9yohykc_-BW_laFm3xcf2nquJkxW\/s16000\/Screenshot%202024-12-25%20010535.png\" \/><\/a><\/div>\n<p><\/p>\n<p>The code as follows:&nbsp;<\/p>\n<p><b>**Please read the important instruction in the code.<\/b><\/p>\n<div style=\"background-color: #131722; color: white; font-family: Menlo, &quot;Ubuntu Mono&quot;, Consolas, source-code-pro, monospace, Consolas, &quot;Courier New&quot;, monospace; font-size: 13px; line-height: 18px; white-space: pre;\">\n<div><span style=\"color: #787b86;\">\/\/<\/span><span style=\"color: #787b86; font-weight: bold;\">@version=<\/span><span style=\"color: #787b86;\">5<\/span><\/div>\n<div><span style=\"color: #5b9cf6;\">strategy<\/span>(<span style=\"color: #388e3c;\">&#8220;SUI(Binance TF5)www.capayam.com&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">overlay<\/span><span style=\"color: #42bda8;\">=<\/span><span style=\"color: #f77c80;\">false<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">initial_capital<\/span><span style=\"color: #42bda8;\">=<\/span><span style=\"color: #f57f17;\">168<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">default_qty_type<\/span><span style=\"color: #42bda8;\">=<\/span><span style=\"color: #f77c80;\">strategy.percent_of_equity<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">default_qty_value<\/span><span style=\"color: #42bda8;\">=<\/span><span style=\"color: #f57f17;\">100<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">pyramiding<\/span><span style=\"color: #42bda8;\">=<\/span><span style=\"color: #f57f17;\">10<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">commission_type<\/span><span style=\"color: #42bda8;\">=<\/span><span style=\"color: #f77c80;\">strategy.commission.percent<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">commission_value<\/span><span style=\"color: #42bda8;\">=<\/span><span style=\"color: #f57f17;\">0.12<\/span>)<\/div>\n<div><\/div>\n<div><span style=\"color: #787b86;\">\/\/ IMPORTANT!! Pay attention to Initial Capital, it equals to capital required in wallet.<\/span><\/div>\n<div><span style=\"color: #787b86;\">\/\/ Usual minimum buy is 5usdt in many exchanges, thus the Initial Buy is 5.2usdt<\/span><\/div>\n<div><span style=\"color: #787b86;\">\/\/ Capital needed for IB 5.2usdt: Multiplier 1.5 ~168usdt, Multiplier 1.75 ~342 usdt, Multiplier 2.0 ~661 usdt<\/span><\/div>\n<div><span style=\"color: #787b86;\">\/\/ IMPORTANT! You MUST set the trading date to start on the day after today, meaning the earliest is tomorrow.<\/span><\/div>\n<div><span style=\"color: #787b86;\">\/\/ IMPORTANT!! Ensure the decimals are correct; 1zero=1decimals, 2zeroes=2decimals, 0zeroes=NoDecimals<\/span><\/div>\n<p><\/p>\n<div><span style=\"color: #787b86;\">\/\/ Inputs<\/span><\/div>\n<div><span style=\"color: #d1d4dc;\">percentageDrop<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #5b9cf6;\">input.float<\/span>(<span style=\"color: #f57f17;\">2.7<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">title<\/span><span style=\"color: #42bda8;\">=<\/span><span style=\"color: #388e3c;\">&#8220;Percentage Drop for Position Increase (%)&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">step<\/span><span style=\"color: #42bda8;\">=<\/span><span style=\"color: #f57f17;\">0.1<\/span>) <span style=\"color: #42bda8;\">\/<\/span> <span style=\"color: #f57f17;\">100<\/span><\/div>\n<div><span style=\"color: #d1d4dc;\">maxPositions<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #5b9cf6;\">input.int<\/span>(<span style=\"color: #f57f17;\">7<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">title<\/span><span style=\"color: #42bda8;\">=<\/span><span style=\"color: #388e3c;\">&#8220;Max Positions (adjust in Pyramiding as well)&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">minval<\/span><span style=\"color: #42bda8;\">=<\/span><span style=\"color: #f57f17;\">1<\/span>)<\/div>\n<div><span style=\"color: #d1d4dc;\">multiplier<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #5b9cf6;\">input.float<\/span>(<span style=\"color: #f57f17;\">1.5<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">title<\/span><span style=\"color: #42bda8;\">=<\/span><span style=\"color: #388e3c;\">&#8220;Multiplier for Position Increase&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">minval<\/span><span style=\"color: #42bda8;\">=<\/span><span style=\"color: #f57f17;\">1<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">step<\/span><span style=\"color: #42bda8;\">=<\/span><span style=\"color: #f57f17;\">0.1<\/span>)<\/div>\n<div><span style=\"color: #d1d4dc;\">takeProfitPct<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #5b9cf6;\">input.float<\/span>(<span style=\"color: #f57f17;\">2.7<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">title<\/span><span style=\"color: #42bda8;\">=<\/span><span style=\"color: #388e3c;\">&#8220;Take Profit Percentage (%)&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">step<\/span><span style=\"color: #42bda8;\">=<\/span><span style=\"color: #f57f17;\">0.1<\/span>) <span style=\"color: #42bda8;\">\/<\/span> <span style=\"color: #f57f17;\">100<\/span><\/div>\n<div><span style=\"color: #d1d4dc;\">initialCapital<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #5b9cf6;\">input.float<\/span>(<span style=\"color: #f57f17;\">5.2<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">title<\/span><span style=\"color: #42bda8;\">=<\/span><span style=\"color: #388e3c;\">&#8220;Initial Buy(adjust in initialCapital accordingly)&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">step<\/span><span style=\"color: #42bda8;\">=<\/span><span style=\"color: #f57f17;\">0.1<\/span>)<\/div>\n<div><span style=\"color: #d1d4dc;\">stopLossPct<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #5b9cf6;\">input.float<\/span>(<span style=\"color: #f57f17;\">99<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">title<\/span><span style=\"color: #42bda8;\">=<\/span><span style=\"color: #388e3c;\">&#8220;Stop Loss Percentage (%)&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">step<\/span><span style=\"color: #42bda8;\">=<\/span><span style=\"color: #f57f17;\">0.1<\/span>) <span style=\"color: #42bda8;\">\/<\/span> <span style=\"color: #f57f17;\">100<\/span><\/div>\n<div><span style=\"color: #d1d4dc;\">show_time<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #5b9cf6;\">input<\/span>(<span style=\"color: #f77c80;\">true<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">title<\/span><span style=\"color: #42bda8;\">=<\/span><span style=\"color: #388e3c;\">&#8220;&#8212;Start Stop (Optional)&#8212;&#8220;<\/span>)<\/div>\n<div><span style=\"color: #d1d4dc;\">start_year<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #5b9cf6;\">input<\/span>(<span style=\"color: #f57f17;\">2024<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">title<\/span><span style=\"color: #42bda8;\">=<\/span><span style=\"color: #388e3c;\">&#8220;Start Year&#8221;<\/span>)<\/div>\n<div><span style=\"color: #d1d4dc;\">start_month<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #5b9cf6;\">input<\/span>(<span style=\"color: #f57f17;\">12<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">title<\/span><span style=\"color: #42bda8;\">=<\/span><span style=\"color: #388e3c;\">&#8220;Start Month (1-12)&#8221;<\/span>)<\/div>\n<div><span style=\"color: #d1d4dc;\">start_day<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #5b9cf6;\">input<\/span>(<span style=\"color: #f57f17;\">14<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">title<\/span><span style=\"color: #42bda8;\">=<\/span><span style=\"color: #388e3c;\">&#8220;Start Day (1-31)&#8221;<\/span>)<\/div>\n<div><span style=\"color: #d1d4dc;\">stop_year<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #5b9cf6;\">input<\/span>(<span style=\"color: #f57f17;\">2025<\/span><span style=\"color: #42bda8;\">,<\/span><span style=\"color: #d1d4dc;\">title<\/span><span style=\"color: #42bda8;\">=<\/span><span style=\"color: #388e3c;\">&#8220;Stop Year&#8221;<\/span>)<\/div>\n<div><span style=\"color: #d1d4dc;\">stop_month<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #5b9cf6;\">input<\/span>(<span style=\"color: #f57f17;\">12<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">title<\/span><span style=\"color: #42bda8;\">=<\/span><span style=\"color: #388e3c;\">&#8220;Stop Month (1-12)&#8221;<\/span>)<\/div>\n<div><span style=\"color: #d1d4dc;\">stop_day<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #5b9cf6;\">input<\/span>(<span style=\"color: #f57f17;\">31<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">title<\/span><span style=\"color: #42bda8;\">=<\/span><span style=\"color: #388e3c;\">&#8220;Stop Day (1-31)&#8221;<\/span>)<\/div>\n<p><\/p>\n<div><span style=\"color: #787b86;\">\/\/ Create timestamps from the input dates<\/span><\/div>\n<div><span style=\"color: #d1d4dc;\">start_trading_date<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #5b9cf6;\">timestamp<\/span>(<span style=\"color: #d1d4dc;\">start_year<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">start_month<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">start_day<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #f57f17;\">0<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #f57f17;\">0<\/span>)<\/div>\n<div><span style=\"color: #d1d4dc;\">stop_trading_date<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #5b9cf6;\">timestamp<\/span>(<span style=\"color: #d1d4dc;\">stop_year<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">stop_month<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">stop_day<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #f57f17;\">23<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #f57f17;\">59<\/span>)<\/div>\n<p><\/p>\n<div><span style=\"color: #787b86;\">\/\/ Variables<\/span><\/div>\n<div><span style=\"color: #42bda8;\">var<\/span> <span style=\"color: #42bda8; font-weight: bold;\">float<\/span> <span style=\"color: #d1d4dc;\">averageEntry<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #f77c80;\">na<\/span><\/div>\n<div><span style=\"color: #42bda8;\">var<\/span> <span style=\"color: #42bda8; font-weight: bold;\">float<\/span> <span style=\"color: #d1d4dc;\">totalPositionSize<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #f57f17;\">0<\/span><\/div>\n<div><span style=\"color: #42bda8;\">var<\/span> <span style=\"color: #42bda8; font-weight: bold;\">float<\/span> <span style=\"color: #d1d4dc;\">totalCost<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #f57f17;\">0<\/span><\/div>\n<div><span style=\"color: #42bda8;\">var<\/span> <span style=\"color: #42bda8; font-weight: bold;\">int<\/span> <span style=\"color: #d1d4dc;\">positionCount<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #f57f17;\">0<\/span><\/div>\n<div><span style=\"color: #42bda8;\">var<\/span> <span style=\"color: #42bda8; font-weight: bold;\">float<\/span> <span style=\"color: #d1d4dc;\">lastPositionSize<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #f77c80;\">na<\/span> <span style=\"color: #787b86;\">\/\/ Track the last added position size<\/span><\/div>\n<p><\/p>\n<div><span style=\"color: #787b86;\">\/\/ Price Levels<\/span><\/div>\n<div><span style=\"color: #d1d4dc;\">dropLevel<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #5b9cf6;\">na<\/span>(<span style=\"color: #d1d4dc;\">averageEntry<\/span>) <span style=\"color: #42bda8;\">?<\/span> <span style=\"color: #f77c80;\">na<\/span> <span style=\"color: #42bda8;\">:<\/span> <span style=\"color: #d1d4dc;\">averageEntry<\/span> <span style=\"color: #42bda8;\">*<\/span> (<span style=\"color: #f57f17;\">1<\/span> <span style=\"color: #42bda8;\">&#8211;<\/span> <span style=\"color: #d1d4dc;\">percentageDrop<\/span>)<\/div>\n<div><span style=\"color: #d1d4dc;\">takeProfitLevel<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #5b9cf6;\">na<\/span>(<span style=\"color: #d1d4dc;\">averageEntry<\/span>) <span style=\"color: #42bda8;\">?<\/span> <span style=\"color: #f77c80;\">na<\/span> <span style=\"color: #42bda8;\">:<\/span> <span style=\"color: #d1d4dc;\">averageEntry<\/span> <span style=\"color: #42bda8;\">*<\/span> (<span style=\"color: #f57f17;\">1<\/span> <span style=\"color: #42bda8;\">+<\/span> <span style=\"color: #d1d4dc;\">takeProfitPct<\/span>)<\/div>\n<div><span style=\"color: #d1d4dc;\">stopLossLevel<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #5b9cf6;\">na<\/span>(<span style=\"color: #d1d4dc;\">averageEntry<\/span>) <span style=\"color: #42bda8;\">?<\/span> <span style=\"color: #f77c80;\">na<\/span> <span style=\"color: #42bda8;\">:<\/span> <span style=\"color: #d1d4dc;\">averageEntry<\/span> <span style=\"color: #42bda8;\">*<\/span> (<span style=\"color: #f57f17;\">1<\/span> <span style=\"color: #42bda8;\">&#8211;<\/span> <span style=\"color: #d1d4dc;\">stopLossPct<\/span>)<\/div>\n<p><\/p>\n<div><span style=\"color: #787b86;\">\/\/ Entry Condition [ADJUST DECIMALS ACCORDINGLY]<\/span><\/div>\n<div><span style=\"color: #42bda8;\">if<\/span> <span style=\"color: #5b9cf6;\">na<\/span>(<span style=\"color: #d1d4dc;\">averageEntry<\/span>) <span style=\"color: #42bda8;\">and<\/span> <span style=\"color: #d1d4dc;\">positionCount<\/span> <span style=\"color: #42bda8;\">==<\/span> <span style=\"color: #f57f17;\">0<\/span> <span style=\"color: #42bda8;\">and<\/span> (<span style=\"color: #f77c80;\">time<\/span> <span style=\"color: #42bda8;\">&gt;=<\/span> <span style=\"color: #d1d4dc;\">start_trading_date<\/span>) <span style=\"color: #42bda8;\">and<\/span> (<span style=\"color: #f77c80;\">time<\/span> <span style=\"color: #42bda8;\">&lt;=<\/span> <span style=\"color: #d1d4dc;\">stop_trading_date<\/span>)<\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">initialQty<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #5b9cf6;\">math.round<\/span>((<span style=\"color: #d1d4dc;\">initialCapital<\/span> <span style=\"color: #42bda8;\">\/<\/span> <span style=\"color: #f77c80;\">close<\/span>) <span style=\"color: #42bda8;\">*<\/span> <span style=\"color: #f57f17;\">10<\/span>) <span style=\"color: #42bda8;\">\/<\/span> <span style=\"color: #f57f17;\">10<\/span><\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #5b9cf6;\">strategy.entry<\/span>(<span style=\"color: #388e3c;\">&#8220;Initial Buy&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #f77c80;\">strategy.long<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">qty<\/span><span style=\"color: #42bda8;\">=<\/span><span style=\"color: #d1d4dc;\">initialQty<\/span>)<\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">averageEntry<\/span> <span style=\"color: #42bda8;\">:=<\/span> <span style=\"color: #f77c80;\">close<\/span><\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">totalPositionSize<\/span> <span style=\"color: #42bda8;\">:=<\/span> <span style=\"color: #d1d4dc;\">initialQty<\/span><\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">totalCost<\/span> <span style=\"color: #42bda8;\">:=<\/span> <span style=\"color: #d1d4dc;\">initialQty<\/span> <span style=\"color: #42bda8;\">*<\/span> <span style=\"color: #f77c80;\">close<\/span><\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">positionCount<\/span> <span style=\"color: #42bda8;\">:=<\/span> <span style=\"color: #f57f17;\">1<\/span><\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">lastPositionSize<\/span> <span style=\"color: #42bda8;\">:=<\/span> <span style=\"color: #d1d4dc;\">initialQty<\/span> <span style=\"color: #787b86;\">\/\/ Initialize the last position size<\/span><\/div>\n<p><\/p>\n<div><span style=\"color: #42bda8;\">if<\/span> <span style=\"color: #42bda8;\">not<\/span> <span style=\"color: #5b9cf6;\">na<\/span>(<span style=\"color: #d1d4dc;\">averageEntry<\/span>) <span style=\"color: #42bda8;\">and<\/span> <span style=\"color: #f77c80;\">close<\/span> <span style=\"color: #42bda8;\">&lt;=<\/span> <span style=\"color: #d1d4dc;\">dropLevel<\/span> <span style=\"color: #42bda8;\">and<\/span> <span style=\"color: #d1d4dc;\">positionCount<\/span> <span style=\"color: #42bda8;\">&lt;<\/span> <span style=\"color: #d1d4dc;\">maxPositions<\/span><\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">newPositionSize<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #d1d4dc;\">lastPositionSize<\/span> <span style=\"color: #42bda8;\">*<\/span> <span style=\"color: #d1d4dc;\">multiplier<\/span> <span style=\"color: #787b86;\">\/\/ Calculate based on the last position size<\/span><\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">roundedQty<\/span> <span style=\"color: #42bda8;\">=<\/span> <span style=\"color: #5b9cf6;\">math.round<\/span>(<span style=\"color: #d1d4dc;\">newPositionSize<\/span> <span style=\"color: #42bda8;\">*<\/span> <span style=\"color: #f57f17;\">10<\/span>) <span style=\"color: #42bda8;\">\/<\/span> <span style=\"color: #f57f17;\">10<\/span><\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #5b9cf6;\">strategy.entry<\/span>(<span style=\"color: #388e3c;\">&#8220;Add Position&#8221;<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #f77c80;\">strategy.long<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">qty<\/span><span style=\"color: #42bda8;\">=<\/span><span style=\"color: #d1d4dc;\">roundedQty<\/span>)<\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">totalCost<\/span> <span style=\"color: #42bda8;\">:=<\/span> <span style=\"color: #d1d4dc;\">totalCost<\/span> <span style=\"color: #42bda8;\">+<\/span> <span style=\"color: #d1d4dc;\">roundedQty<\/span> <span style=\"color: #42bda8;\">*<\/span> <span style=\"color: #f77c80;\">close<\/span><\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">totalPositionSize<\/span> <span style=\"color: #42bda8;\">:=<\/span> <span style=\"color: #d1d4dc;\">totalPositionSize<\/span> <span style=\"color: #42bda8;\">+<\/span> <span style=\"color: #d1d4dc;\">roundedQty<\/span><\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">averageEntry<\/span> <span style=\"color: #42bda8;\">:=<\/span> <span style=\"color: #d1d4dc;\">totalCost<\/span> <span style=\"color: #42bda8;\">\/<\/span> <span style=\"color: #d1d4dc;\">totalPositionSize<\/span><\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">positionCount<\/span> <span style=\"color: #42bda8;\">:=<\/span> <span style=\"color: #d1d4dc;\">positionCount<\/span> <span style=\"color: #42bda8;\">+<\/span> <span style=\"color: #f57f17;\">1<\/span><\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">lastPositionSize<\/span> <span style=\"color: #42bda8;\">:=<\/span> <span style=\"color: #d1d4dc;\">roundedQty<\/span> <span style=\"color: #787b86;\">\/\/ Update the last position size<\/span><\/div>\n<p><\/p>\n<div><span style=\"color: #787b86;\">\/\/ Take Profit Condition<\/span><\/div>\n<div><span style=\"color: #42bda8;\">if<\/span> <span style=\"color: #42bda8;\">not<\/span> <span style=\"color: #5b9cf6;\">na<\/span>(<span style=\"color: #d1d4dc;\">averageEntry<\/span>) <span style=\"color: #42bda8;\">and<\/span> <span style=\"color: #f77c80;\">close<\/span> <span style=\"color: #42bda8;\">&gt;=<\/span> <span style=\"color: #d1d4dc;\">takeProfitLevel<\/span><\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #5b9cf6;\">strategy.close<\/span>(<span style=\"color: #388e3c;\">&#8220;Initial Buy&#8221;<\/span>)<\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #5b9cf6;\">strategy.close<\/span>(<span style=\"color: #388e3c;\">&#8220;Add Position&#8221;<\/span>)<\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">averageEntry<\/span> <span style=\"color: #42bda8;\">:=<\/span> <span style=\"color: #f77c80;\">na<\/span><\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">totalPositionSize<\/span> <span style=\"color: #42bda8;\">:=<\/span> <span style=\"color: #f57f17;\">0<\/span><\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">totalCost<\/span> <span style=\"color: #42bda8;\">:=<\/span> <span style=\"color: #f57f17;\">0<\/span><\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">positionCount<\/span> <span style=\"color: #42bda8;\">:=<\/span> <span style=\"color: #f57f17;\">0<\/span><\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">lastPositionSize<\/span> <span style=\"color: #42bda8;\">:=<\/span> <span style=\"color: #f77c80;\">na<\/span> <span style=\"color: #787b86;\">\/\/ Reset the last position size<\/span><\/div>\n<p><\/p>\n<div><span style=\"color: #787b86;\">\/\/ Stop-Loss Condition<\/span><\/div>\n<div><span style=\"color: #42bda8;\">if<\/span> <span style=\"color: #42bda8;\">not<\/span> <span style=\"color: #5b9cf6;\">na<\/span>(<span style=\"color: #d1d4dc;\">averageEntry<\/span>) <span style=\"color: #42bda8;\">and<\/span> <span style=\"color: #f77c80;\">close<\/span> <span style=\"color: #42bda8;\">&lt;=<\/span> <span style=\"color: #d1d4dc;\">stopLossLevel<\/span><\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #5b9cf6;\">strategy.close<\/span>(<span style=\"color: #388e3c;\">&#8220;Initial Buy&#8221;<\/span>)<\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #5b9cf6;\">strategy.close<\/span>(<span style=\"color: #388e3c;\">&#8220;Add Position&#8221;<\/span>)<\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">averageEntry<\/span> <span style=\"color: #42bda8;\">:=<\/span> <span style=\"color: #f77c80;\">na<\/span><\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">totalPositionSize<\/span> <span style=\"color: #42bda8;\">:=<\/span> <span style=\"color: #f57f17;\">0<\/span><\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">totalCost<\/span> <span style=\"color: #42bda8;\">:=<\/span> <span style=\"color: #f57f17;\">0<\/span><\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">positionCount<\/span> <span style=\"color: #42bda8;\">:=<\/span> <span style=\"color: #f57f17;\">0<\/span><\/div>\n<div>&nbsp; &nbsp; <span style=\"color: #d1d4dc;\">lastPositionSize<\/span> <span style=\"color: #42bda8;\">:=<\/span> <span style=\"color: #f77c80;\">na<\/span> <span style=\"color: #787b86;\">\/\/ Reset the last position size<\/span><\/div>\n<p><\/p>\n<div><span style=\"color: #787b86;\">\/\/ Plotting<\/span><\/div>\n<div><span style=\"color: #5b9cf6;\">plot<\/span>(<span style=\"color: #d1d4dc;\">averageEntry<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">color<\/span><span style=\"color: #42bda8;\">=<\/span><span style=\"color: #f77c80;\">color.blue<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">title<\/span><span style=\"color: #42bda8;\">=<\/span><span style=\"color: #388e3c;\">&#8220;Average Entry&#8221;<\/span>)<\/div>\n<div><span style=\"color: #5b9cf6;\">plot<\/span>(<span style=\"color: #d1d4dc;\">takeProfitLevel<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">color<\/span><span style=\"color: #42bda8;\">=<\/span><span style=\"color: #f77c80;\">color.green<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">title<\/span><span style=\"color: #42bda8;\">=<\/span><span style=\"color: #388e3c;\">&#8220;Take Profit Level&#8221;<\/span>)<\/div>\n<div><span style=\"color: #5b9cf6;\">plot<\/span>(<span style=\"color: #d1d4dc;\">dropLevel<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">color<\/span><span style=\"color: #42bda8;\">=<\/span><span style=\"color: #f77c80;\">color.red<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">title<\/span><span style=\"color: #42bda8;\">=<\/span><span style=\"color: #388e3c;\">&#8220;Drop Level&#8221;<\/span>)<\/div>\n<div><span style=\"color: #5b9cf6;\">plot<\/span>(<span style=\"color: #d1d4dc;\">stopLossLevel<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">color<\/span><span style=\"color: #42bda8;\">=<\/span><span style=\"color: #f77c80;\">color.orange<\/span><span style=\"color: #42bda8;\">,<\/span> <span style=\"color: #d1d4dc;\">title<\/span><span style=\"color: #42bda8;\">=<\/span><span style=\"color: #388e3c;\">&#8220;Stop Loss Level&#8221;<\/span>)<\/div>\n<p><\/div>\n<p><\/p>\n<p>Don&#8217;t know how to set up your own bot?&nbsp;<b><a href=\"https:\/\/www.capayam.com\/p\/how-to-start-your-own-trading-bots-its.html\" target=\"_blank\">Read here<\/a><\/b>, its easy!<\/p>\n<div>ref:code 213<\/div>\n<div><\/div><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This script actually does not really involve any Technical Analysis (TA). It just a bot that runs on traditional martingale strategy. Martingale startegy is&nbsp;a risk management strategy that originated in<\/p>\n<p><a href=\"https:\/\/kriptos.my\/index.php\/2024\/12\/24\/new-pine-scipt-martingale-strategy\/\" class=\"btn btn-skin btn-radius\">Continue Reading<span class=\"screen-reader-text\">New Pine Scipt: Martingale Strategy<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[3],"class_list":["post-9","post","type-post","status-publish","format-standard","hentry","category-pine-script-strategy","tag-pine-script-strategy"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.3.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>New Pine Scipt: Martingale Strategy - kriptos.my<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/kriptos.my\/index.php\/2024\/12\/24\/new-pine-scipt-martingale-strategy\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"New Pine Scipt: Martingale Strategy - kriptos.my\" \/>\n<meta property=\"og:description\" content=\"This script actually does not really involve any Technical Analysis (TA). It just a bot that runs on traditional martingale strategy. Martingale startegy is&nbsp;a risk management strategy that originated inContinue ReadingNew Pine Scipt: Martingale Strategy\" \/>\n<meta property=\"og:url\" content=\"https:\/\/kriptos.my\/index.php\/2024\/12\/24\/new-pine-scipt-martingale-strategy\/\" \/>\n<meta property=\"og:site_name\" content=\"kriptos.my\" \/>\n<meta property=\"article:published_time\" content=\"2024-12-24T17:09:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-21T15:30:04+00:00\" \/>\n<meta name=\"author\" content=\"kriptos\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"kriptos\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/kriptos.my\/index.php\/2024\/12\/24\/new-pine-scipt-martingale-strategy\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/kriptos.my\/index.php\/2024\/12\/24\/new-pine-scipt-martingale-strategy\/\"},\"author\":{\"name\":\"kriptos\",\"@id\":\"https:\/\/kriptos.my\/#\/schema\/person\/ab6ae0f7dc407600d321d44b02da9556\"},\"headline\":\"New Pine Scipt: Martingale Strategy\",\"datePublished\":\"2024-12-24T17:09:00+00:00\",\"dateModified\":\"2025-06-21T15:30:04+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/kriptos.my\/index.php\/2024\/12\/24\/new-pine-scipt-martingale-strategy\/\"},\"wordCount\":674,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/kriptos.my\/#organization\"},\"image\":{\"@id\":\"https:\/\/kriptos.my\/index.php\/2024\/12\/24\/new-pine-scipt-martingale-strategy\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEi2WHfCkAoDceRfRZwo3Csscy_ol6ERHECbrlWMEysoUyrl4eT9baZrwBS7CcSBPBEELkayS81YSwj5x_FNe4cG7GZBTK8Fc-cML_cSGcd2h_ACT4KcyF3VumjLcHH2ZLevXeXSkDyIqAIj6GKCBpeKKfZ5fQzrsJoM9yohykc_-BW_laFm3xcf2nquJkxW\/s16000\/Screenshot%202024-12-25%20010535.png\",\"keywords\":[\"Pine Script Strategy\"],\"articleSection\":[\"Pine Script Strategy\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/kriptos.my\/index.php\/2024\/12\/24\/new-pine-scipt-martingale-strategy\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/kriptos.my\/index.php\/2024\/12\/24\/new-pine-scipt-martingale-strategy\/\",\"url\":\"https:\/\/kriptos.my\/index.php\/2024\/12\/24\/new-pine-scipt-martingale-strategy\/\",\"name\":\"New Pine Scipt: Martingale Strategy - kriptos.my\",\"isPartOf\":{\"@id\":\"https:\/\/kriptos.my\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/kriptos.my\/index.php\/2024\/12\/24\/new-pine-scipt-martingale-strategy\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/kriptos.my\/index.php\/2024\/12\/24\/new-pine-scipt-martingale-strategy\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEi2WHfCkAoDceRfRZwo3Csscy_ol6ERHECbrlWMEysoUyrl4eT9baZrwBS7CcSBPBEELkayS81YSwj5x_FNe4cG7GZBTK8Fc-cML_cSGcd2h_ACT4KcyF3VumjLcHH2ZLevXeXSkDyIqAIj6GKCBpeKKfZ5fQzrsJoM9yohykc_-BW_laFm3xcf2nquJkxW\/s16000\/Screenshot%202024-12-25%20010535.png\",\"datePublished\":\"2024-12-24T17:09:00+00:00\",\"dateModified\":\"2025-06-21T15:30:04+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/kriptos.my\/index.php\/2024\/12\/24\/new-pine-scipt-martingale-strategy\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/kriptos.my\/index.php\/2024\/12\/24\/new-pine-scipt-martingale-strategy\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/kriptos.my\/index.php\/2024\/12\/24\/new-pine-scipt-martingale-strategy\/#primaryimage\",\"url\":\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEi2WHfCkAoDceRfRZwo3Csscy_ol6ERHECbrlWMEysoUyrl4eT9baZrwBS7CcSBPBEELkayS81YSwj5x_FNe4cG7GZBTK8Fc-cML_cSGcd2h_ACT4KcyF3VumjLcHH2ZLevXeXSkDyIqAIj6GKCBpeKKfZ5fQzrsJoM9yohykc_-BW_laFm3xcf2nquJkxW\/s16000\/Screenshot%202024-12-25%20010535.png\",\"contentUrl\":\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEi2WHfCkAoDceRfRZwo3Csscy_ol6ERHECbrlWMEysoUyrl4eT9baZrwBS7CcSBPBEELkayS81YSwj5x_FNe4cG7GZBTK8Fc-cML_cSGcd2h_ACT4KcyF3VumjLcHH2ZLevXeXSkDyIqAIj6GKCBpeKKfZ5fQzrsJoM9yohykc_-BW_laFm3xcf2nquJkxW\/s16000\/Screenshot%202024-12-25%20010535.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/kriptos.my\/index.php\/2024\/12\/24\/new-pine-scipt-martingale-strategy\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/kriptos.my\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"New Pine Scipt: Martingale Strategy\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/kriptos.my\/#website\",\"url\":\"https:\/\/kriptos.my\/\",\"name\":\"kriptos.my\",\"description\":\"Trading Bot Enthusiast\",\"publisher\":{\"@id\":\"https:\/\/kriptos.my\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/kriptos.my\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/kriptos.my\/#organization\",\"name\":\"kriptos.my\",\"url\":\"https:\/\/kriptos.my\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/kriptos.my\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/kriptos.my\/wp-content\/uploads\/2025\/06\/cropped-kriptosmy-perkataan.png\",\"contentUrl\":\"https:\/\/kriptos.my\/wp-content\/uploads\/2025\/06\/cropped-kriptosmy-perkataan.png\",\"width\":872,\"height\":199,\"caption\":\"kriptos.my\"},\"image\":{\"@id\":\"https:\/\/kriptos.my\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/kriptos.my\/#\/schema\/person\/ab6ae0f7dc407600d321d44b02da9556\",\"name\":\"kriptos\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/kriptos.my\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/a20605acecdd9f3d901b43544301ee4d59d4b1755e81596045ff947403d36442?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/a20605acecdd9f3d901b43544301ee4d59d4b1755e81596045ff947403d36442?s=96&d=mm&r=g\",\"caption\":\"kriptos\"},\"url\":\"https:\/\/kriptos.my\/index.php\/author\/08464702926718497666\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"New Pine Scipt: Martingale Strategy - kriptos.my","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/kriptos.my\/index.php\/2024\/12\/24\/new-pine-scipt-martingale-strategy\/","og_locale":"en_US","og_type":"article","og_title":"New Pine Scipt: Martingale Strategy - kriptos.my","og_description":"This script actually does not really involve any Technical Analysis (TA). It just a bot that runs on traditional martingale strategy. Martingale startegy is&nbsp;a risk management strategy that originated inContinue ReadingNew Pine Scipt: Martingale Strategy","og_url":"https:\/\/kriptos.my\/index.php\/2024\/12\/24\/new-pine-scipt-martingale-strategy\/","og_site_name":"kriptos.my","article_published_time":"2024-12-24T17:09:00+00:00","article_modified_time":"2025-06-21T15:30:04+00:00","author":"kriptos","twitter_card":"summary_large_image","twitter_misc":{"Written by":"kriptos","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/kriptos.my\/index.php\/2024\/12\/24\/new-pine-scipt-martingale-strategy\/#article","isPartOf":{"@id":"https:\/\/kriptos.my\/index.php\/2024\/12\/24\/new-pine-scipt-martingale-strategy\/"},"author":{"name":"kriptos","@id":"https:\/\/kriptos.my\/#\/schema\/person\/ab6ae0f7dc407600d321d44b02da9556"},"headline":"New Pine Scipt: Martingale Strategy","datePublished":"2024-12-24T17:09:00+00:00","dateModified":"2025-06-21T15:30:04+00:00","mainEntityOfPage":{"@id":"https:\/\/kriptos.my\/index.php\/2024\/12\/24\/new-pine-scipt-martingale-strategy\/"},"wordCount":674,"commentCount":0,"publisher":{"@id":"https:\/\/kriptos.my\/#organization"},"image":{"@id":"https:\/\/kriptos.my\/index.php\/2024\/12\/24\/new-pine-scipt-martingale-strategy\/#primaryimage"},"thumbnailUrl":"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEi2WHfCkAoDceRfRZwo3Csscy_ol6ERHECbrlWMEysoUyrl4eT9baZrwBS7CcSBPBEELkayS81YSwj5x_FNe4cG7GZBTK8Fc-cML_cSGcd2h_ACT4KcyF3VumjLcHH2ZLevXeXSkDyIqAIj6GKCBpeKKfZ5fQzrsJoM9yohykc_-BW_laFm3xcf2nquJkxW\/s16000\/Screenshot%202024-12-25%20010535.png","keywords":["Pine Script Strategy"],"articleSection":["Pine Script Strategy"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/kriptos.my\/index.php\/2024\/12\/24\/new-pine-scipt-martingale-strategy\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/kriptos.my\/index.php\/2024\/12\/24\/new-pine-scipt-martingale-strategy\/","url":"https:\/\/kriptos.my\/index.php\/2024\/12\/24\/new-pine-scipt-martingale-strategy\/","name":"New Pine Scipt: Martingale Strategy - kriptos.my","isPartOf":{"@id":"https:\/\/kriptos.my\/#website"},"primaryImageOfPage":{"@id":"https:\/\/kriptos.my\/index.php\/2024\/12\/24\/new-pine-scipt-martingale-strategy\/#primaryimage"},"image":{"@id":"https:\/\/kriptos.my\/index.php\/2024\/12\/24\/new-pine-scipt-martingale-strategy\/#primaryimage"},"thumbnailUrl":"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEi2WHfCkAoDceRfRZwo3Csscy_ol6ERHECbrlWMEysoUyrl4eT9baZrwBS7CcSBPBEELkayS81YSwj5x_FNe4cG7GZBTK8Fc-cML_cSGcd2h_ACT4KcyF3VumjLcHH2ZLevXeXSkDyIqAIj6GKCBpeKKfZ5fQzrsJoM9yohykc_-BW_laFm3xcf2nquJkxW\/s16000\/Screenshot%202024-12-25%20010535.png","datePublished":"2024-12-24T17:09:00+00:00","dateModified":"2025-06-21T15:30:04+00:00","breadcrumb":{"@id":"https:\/\/kriptos.my\/index.php\/2024\/12\/24\/new-pine-scipt-martingale-strategy\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/kriptos.my\/index.php\/2024\/12\/24\/new-pine-scipt-martingale-strategy\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/kriptos.my\/index.php\/2024\/12\/24\/new-pine-scipt-martingale-strategy\/#primaryimage","url":"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEi2WHfCkAoDceRfRZwo3Csscy_ol6ERHECbrlWMEysoUyrl4eT9baZrwBS7CcSBPBEELkayS81YSwj5x_FNe4cG7GZBTK8Fc-cML_cSGcd2h_ACT4KcyF3VumjLcHH2ZLevXeXSkDyIqAIj6GKCBpeKKfZ5fQzrsJoM9yohykc_-BW_laFm3xcf2nquJkxW\/s16000\/Screenshot%202024-12-25%20010535.png","contentUrl":"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEi2WHfCkAoDceRfRZwo3Csscy_ol6ERHECbrlWMEysoUyrl4eT9baZrwBS7CcSBPBEELkayS81YSwj5x_FNe4cG7GZBTK8Fc-cML_cSGcd2h_ACT4KcyF3VumjLcHH2ZLevXeXSkDyIqAIj6GKCBpeKKfZ5fQzrsJoM9yohykc_-BW_laFm3xcf2nquJkxW\/s16000\/Screenshot%202024-12-25%20010535.png"},{"@type":"BreadcrumbList","@id":"https:\/\/kriptos.my\/index.php\/2024\/12\/24\/new-pine-scipt-martingale-strategy\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/kriptos.my\/"},{"@type":"ListItem","position":2,"name":"New Pine Scipt: Martingale Strategy"}]},{"@type":"WebSite","@id":"https:\/\/kriptos.my\/#website","url":"https:\/\/kriptos.my\/","name":"kriptos.my","description":"Trading Bot Enthusiast","publisher":{"@id":"https:\/\/kriptos.my\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/kriptos.my\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/kriptos.my\/#organization","name":"kriptos.my","url":"https:\/\/kriptos.my\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/kriptos.my\/#\/schema\/logo\/image\/","url":"https:\/\/kriptos.my\/wp-content\/uploads\/2025\/06\/cropped-kriptosmy-perkataan.png","contentUrl":"https:\/\/kriptos.my\/wp-content\/uploads\/2025\/06\/cropped-kriptosmy-perkataan.png","width":872,"height":199,"caption":"kriptos.my"},"image":{"@id":"https:\/\/kriptos.my\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/kriptos.my\/#\/schema\/person\/ab6ae0f7dc407600d321d44b02da9556","name":"kriptos","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/kriptos.my\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/a20605acecdd9f3d901b43544301ee4d59d4b1755e81596045ff947403d36442?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/a20605acecdd9f3d901b43544301ee4d59d4b1755e81596045ff947403d36442?s=96&d=mm&r=g","caption":"kriptos"},"url":"https:\/\/kriptos.my\/index.php\/author\/08464702926718497666\/"}]}},"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/kriptos.my\/index.php\/wp-json\/wp\/v2\/posts\/9","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kriptos.my\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kriptos.my\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kriptos.my\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/kriptos.my\/index.php\/wp-json\/wp\/v2\/comments?post=9"}],"version-history":[{"count":0,"href":"https:\/\/kriptos.my\/index.php\/wp-json\/wp\/v2\/posts\/9\/revisions"}],"wp:attachment":[{"href":"https:\/\/kriptos.my\/index.php\/wp-json\/wp\/v2\/media?parent=9"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kriptos.my\/index.php\/wp-json\/wp\/v2\/categories?post=9"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kriptos.my\/index.php\/wp-json\/wp\/v2\/tags?post=9"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}