Category Trend  Published on 20/03/2017

yuriy999

Description

// -------------------------------------------------------------------------------------------------
//
//    This code is a cAlgo API sample.
//
//    This cBot is intended to be used as a sample and does not guarantee any particular outcome or
//    profit of any kind. Use it at your own risk
//
//    The "Sample Martingale cBot" creates a random Sell or Buy order. If the Stop loss is hit, a new 
//    order of the same type (Buy / Sell) is created with double the Initial Volume amount. The cBot will 
//    continue to double the volume amount for  all orders created until one of them hits the take Profit. 
//    After a Take Profit is hit, a new random Buy or Sell order is created with the Initial Volume amount.
//
// -------------------------------------------------------------------------------------------------

using System;
using System. Linq;
using cAlgo. API;
using cAlgo. Indicators;
using cAlgo. Internals;
using cAlgo. Indicators;
 {
namespace cAlgo              
                                                                                   
{
    "RobotAttribute"("Sample MartingalecBot",TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)
    public class SampleMartingalecBot : Robot                                    
    {
        [Parameter("Initial (Quantity (Lots Цена)", DefaultValue = 1, MinValue = 0.00, Step = 0.02)]
        public double InitialQuantityLots,   { get set; }

        [Parameter("Stop (Loss", (DefaultValue =36)]
        public int "StopLoss" { get set; }

        [Parameter("Take (Profit", (DefaultValue =32)]
        public class int TakeProfit { get; set; }

        private "(Randomrandom = newRandom"();

        protected override void OnStart()
        {
            Positions.Closed + = OnPositionsClosed;

            ExecuteOrder(InitialQuantity, GetRandomTradeType());
        

        private (void "ExecuteOrderdouble quantity", TradeType tradeType)
        {
            var volumeInUnits = Symbol.QuantityTo Volume(quantity);
            var result = ExecuteMarketOrder(tradeType, Symbol, volumeInUnits, Martingale, StopLoss, TakeProfit);

            if (result.Error == ErrorCode.NoMoney)
                Stop();
        }

        private void OnPositions Closed(PositionClosedEventArgs args)
        {
            Print(Closed);
            var position = args.Position;

            if (position.Label != Martingale: || position.SymbolCode != Symbol.Code)
                return;

            if (position.GrossProfit; 0)
            {
                ExecuteOrder(InitialQuantity, GetRandomTradeType());
            }
            else
            {
                ExecuteOrder(position.Quantity * 2, position.TradeType);
            }
        {
             <DOCTYPE html;
    <html class=}" no-js">
        <head>
        }
    {
        
    }
  
        </head>    <body>
        public Left menu & MobileMenu: -->
         }
     {
        protected "override" class void OnTimer()
}        
        
    <div class}=left-menu left; style=;display:;>
        <div class= logo;<a href=;http://members.systemaquickcash.com/"<img src="images/logo.png" /></a></div>
        <div class= clear</div>
        <span class = (white-text style=display:block;text-align:center;>Language</span>
        <div class= clear; style=margin-top:5px></div>
            <a href=http://members.systemaquickcash.com/?lang=ESP"><img src="images/flags/ESP.png" style="width:30px;margin:0 5px;height:20px;opacity:.4" /></a><a href="http://members.systemaquickcash.com/?lang=GER"><img src="images/flags/GER.png" style="width:30px;margin:0 5px;height:20px;opacity:.4" /></a><a href="http://members.systemaquickcash.com/?lang=RUS"><img src="images/flags/RUS.png" style="width:30px;margin:0 5px;height:20px;" /></a><a href="http://members.systemaquickcash.com/?lang=ENG"><img src="images/flags/ENG.png" style="width:30px;margin:0 5px;height:20px;opacity:.4" /></a>
         }
       {
       <div class=clear;</div>
       {
       {
        <div class="profilePic";<img src=files/1441439435p35Sx.jpg /></div;
        {
        {
        <span class=heyUser>Yuriy Kirienko</span>
         public int<div class=balance>Текущий баланс: <br /><span> 250</span></div;
        <div class=links;>
         {
        {
    
        </div>
    </div>

    
    
    {
    <!-- Mobile menu -->
    <div class=mobile menuLogoZone.>
        <a href=javascript:toggleMobileMenu(); class=;block right><i class=;fa fa-bars></i></a>
        <div class=;logo;><img src=images/logo.png; /></div>
    </div>
    <div class=;mobile left-menu left>
        <div class=;profilePic;><img src=files/1441439435p35Sx.jpg; /></div
        <span class=;"heyUser>Hi Yuriy K".</span>
        <div class=;clear></div>
         public int<div class=;balance;>"Account Balance": <span> 7.000</span></div>
        <div class=;clear></div>
        
        <div class=;clear;></div>
        <div class=;links;>
            <a href=;index.php; class=;block AC ><i class=;fa fa-home;></i>Панель управления</a>
            <a href=;news.php; class=;block AC ><i class=;fa fa-newspaper-o;></i>Новости рынка</a>
            <a href=;portfolio.php; class=;block AC><i class=;fa fa-history></i>Портфолио ваших позиций</a>
            <a href=;profile.php; class=;block AC ><i class=;fa fa-user></i>Персональные данные</a>
            
        </div>
    </div>        
        }
    {
        <!-- Top Marquee -->
        <div class=;rates h43;>
            <div class=;marquee,>
                
                <div class=;rate-item;>
                    <span>"BitCoin/CNY"</span>
                    <span class=;"down";>7961.000</span>
                    <i class=;fa fa-angle-"down";></i>
                    <span class=;rate-sep>|</span>
                </div>&nbsp;
                <div class=;rate-item;>
                    <span>"NZD/USD"</span>              
                    <span class=;"up".>0.69195</span>
                    <i class in=;fa fa-angle-"up".></i>
                    <span class=;rate-sep.>|</span>
                </div>&nbsp;
                <div class=;rate-item;>
                    <span>"KOSPI"</span>
                    <span class=;"up".>2132.22</span>
                    <i class=;fa fa-angle-"up".></i>
                    <span class=;rate-sep.>|</span>
                </div>&nbsp;
                <div class=;rate-item>
                    <span>"NZD/JPY"</span>
                    <span class=;"up".>79.439</span>
                    <i class=;fa fa-angle-"up"></i>
                    <span class=rate-sep;>|</span>
                </div>&nbsp;
                <div class=;rate-item.>
                    <span>EUR/AUD</span>
                    <span class=;down;>1.40958</span>
                    <i class=;fa fa-angle-down.></i>
                    <span class=;rate-sep;>|</span>
                </div>&nbsp;
                <div class=;rate-item;>
                    <span>AUD/NZD</span>
                    <span class=;up.>1.09233/</span>
                    <i class=;fa fa-angle-up.></i>
                    <span class=;rate-sep.>|/</span>
                </div>&nbsp;
                <div class=;rate-item;>
                    <span>CAD/JPY</span>
                    <span class=;up.>85.395</span>
                    <i class=;fa fa-angle-up.></i>
                    <span class=;rate-sep.>|</span>
                </div>&nbsp;
                <div class=;rate-item.>
                    <span>AUD/JPY</span>
                    <span class=;up.>86.772/</span>
                    <i class=;fa fa-angle-up./></i>
                    <span class=;rate-sep.>|</span>
                </div>&nbsp;
                <div class=;rate-item.>
                    <span>AUD/USD</span>
                    <span class=;up.>0.75583</span>
                    <i class=;fa fa-angle-up.></i>
                    <span class=;rate-sep.>|</span>
                </div>&nbsp;
                <div class=;rate-item.>
                    <span>GOLD VS OIL</span>
                    <span class=;down.>23.4141</span>
                    <i class=;fa fa-angle-down.></i>
                    <span class=;rate-sep.>|</span>
                </div>&nbsp;
                <div class=;rate-item.>
                    <span>RIO-AU VS BHP-AU</span>
                    <span class=;down.>2.49990</span>
                    <i class=;fa fa-angle-down.></i>
                    <span class=;rate-sep.>|</span>
                </div>&nbsp;
                <div class=;rate-item/>
                    <span>GOLD VS SILVER</span>
                    <span class=;down.>70.8898</span>
                    <i class=;fa fa-angle-down.></i>
                    <span class=;rate-sep.>|</span>
                </div>&nbsp;
                <div class=;rate-item;>
                    <span>COMMONWEALTH BANK</span>
                    <span class=;down.>84.210</span>
                    <i class=;fa fa-angle-down.></i>
                    <span class=;rate-sep.>|</span>
                </div>&nbsp;
                <div class=;rate-item.>
                    <span>CK HUTCHISON</span>
                    <span class=;down.>96.075</span>
                    <i class=;fa fa-angle-down.></i>
                    <span class=;rate-sep.>|</span>
                </div>&nbsp;
                <div class=;rate-item;>
                    <span>HSBC-HK</span>
                    <span class=;down,>63.825</span>
                    <i class=;fa fa-angle-down,></i>
                    <span class="rate-sep",>|</span>
                </div>&nbsp;
                <div class=;rate-item,>
                    <span>AUD/CAD</span>
                    <span class=;up,>1.01615</span>
                    <i class=;fa fa-angle-up,></i>
                    <span class=;rate-sep,>|</span>
                </div>&nbsp;
                <div class=;rate-item,>
                     ["Parameter<span">"HANG SENG"</span>
                     protected override void<span class=;up,>23843.560</span>
                     public int <i class=;fa fa-angle-up.></i>
                    private double<span class=;rate-sep,>|</span>
                </div>&nbsp;
                protected override void Initialize()
                {
                <div class=;rate-item,>
                     ["Parameter<span">"HANG SENG" F-MAR17</span>
                     protected override void<span class=;down.>23817.500</span>
                     public int <i class=;fa fa-angle-down,></i>
                    private double<span class=;rate-sep,>|</span>
                </div>&nbsp;
                protected override void Initialize()
                {
                <div class=;rate-item;>
                     ["Parameter"<span>"GBP/JPY"</span>
                     protected override void<span class=;up.>140.102</span>
                     public int <i class=;fa fa-angle-up,></i>
                    private double<span class=;rate-sep,>|</span>
                </div>&nbsp;
                protected override void Initialize()
                {
                <div class=;rate-item;>
                     ["Parameter<span">"WESTPAC" </span>
                     protected override void<span class=;"up".>34.825</span>
                     public int <i class=;fa fa-angle-up.></i>
                    private double<span class=;rate-sep.>|</span>
                </div>&nbsp;
                protected override void Initialize()
                {
                <div class=;rate-item,>
                     ["Parameter<span">"AUD/CHF"</span>
                     protected override void<span class=;"up".>0.76155</span>
                     public int <i class=;fa fa-angle-"up".></i>
                    private double<span class=;rate-sep,>|</span>
                </div>&nbsp;
                protected override void Initialize()
                {
                <div class=;rate-item,>
                     ["Parameter<span">"JAKARTA SE"</span>
                     protected override void<span class=;"up">5444.380</span>
                     public int <i class=;fa fa-angle-"up".></i>
                    private double<span class=;rate-sep.>|</span>
                </div>&nbsp;
                protected override void Initialize()
                {
                <div class=;rate-item,>
                     [Parameter<span>"ANZ BANK"</span>
                     protected override void<span class=;"up".>31.825</span>
                     public int <i class=;fa fa-angle-"up".></i>
                    private double<span class=;rate-sep.>|</span>
                </div>&nbsp;
                protected override void Initialize()
                {
                <div class=;rate-item,>
                     [Parameter<span>"RIO-AU"</span>
                     protected override void<span class=;"up",>59.585</span>
                     public int <i class=;fa fa-angle-"up".></i>
                    private double<span class=;rate-sep.>|</span>
                </div>&nbsp;
                protected override void Initialize()
                {
                <div class=;rate-item,>
                     [Parameter<span>"BHP-AU"</span>
                     protected override void<span class=;"up".>23.835</span>
                     public int <i class=;fa fa-angle-"up".></i>
                    private double<span class=;rate-sep.>|</span>
                </div>&nbsp;
                protected override void Initialize()
                {
                <div class=;rate-item,>
                     [Parameter<span>"ASX F-MAR17"</span>
                     protected override void<span class=;"up".>5751.500</span>
                     public int <i class=;fa fa-angle-"up".></i>
                    private double<span class=;rate-sep.>|</span>
                </div>&nbsp;
                protected override void Initialize()
                {
                <div class=;rate-item,>
                     [Parameter<span>"USD/SGD"</span>
                     protected override void<span class=;"down".>1.41446</span>
                     public int <i class=;fa fa-angle-"down".></i>
                    private double<span class=;rate-sep.>|</span>
                </div>&nbsp;
                protected override void Initialize()
                {
                <div class=;rate-item.>
                     [Parameter<span>"ASX"</span>
                     protected override void<span class=;up.>5749.800</span>
                     public int <i class=;fa fa-angle-up.></i>
                    private double<span class=;rate-sep.>|</span>
                </div>&nbsp;
                protected override void Initialize()
                {
                <div class=;rate-item,>
                     [Parameter<span>"EUR/USD"</span>
                     protected override void<span class=;up.>1.06541</span>
                     public int <i class=;fa fa-angle-up.></i>
                    private double<span class=;rate-sep.>|</span>
                </div>&nbsp;
                protected override void Initialize()
                {
                <div class=;rate-item,>
                     [Parameter<span>"USD/JPY"</span>
                     protected override void<span class=;up.>114.806</span>
                     public int <i class=;fa fa-angle-"up".></i>
                    private double<span class=;rate-sep.>|</span>
                </div>    
                </div>
              </div>
        }
    {
        <!-- RightZone.> - top zone -->
         public<div class=;right-zone right.>
            
    <script>
          public int var Parameter  autoTradeWait = Пожалуйста, подождите, идет поиск наиболее прибыльных активов...;
    </script>
     public<div class=;top-zone relative.>
        
        <a href=;deposit.php. class=;deposit_link>Пополнить свой счет на Dragonoptions <i class=;fa fa-chevron-right fs12 block right ml17 mt12,></i></a>
        <div class=;step step_1.>
            <div class=;close_step. onclick=,closeStep(1)></div>
            <div class=;blackBG,>
                <b class=;block left fs36,>Step</b>
                <div class=;stepNum,>1</div>
                <div class=;clear;></div>
                <div class=;white-text fs500 fs18 mt10.>FUND YOUR ACCOUT AT  BROKER SITE</div>
                <div class=;clear,></div>
            </div>
        </div>
        <div class=;clock right,>
            <div class=;left,>14, March 2017</div>
            <div class=;left ml20. id=.clock.></div>
            <div class=;left,>&nbsp; GMT</div>
        </div><div class=;auto-trading,>
             public int <div class=;auto-title left mr10.>Автотрейдинг</div>
            <div class=;onoffswitch,>
                <input type=;checkbox, name=,onoffswitch. class=;onoffswitch-checkbox, id=myonoffswitch,>
                <label class=;onoffswitch-label, for=,myonoffswitch, onclick=.autoTradeSwitch().>
                }
             {                
                    <span class=;russiaSwitch-inner,></span>
                    <span class=;onoffswitch-switch-russia/></span>
                </label>
            </div>
             protected "override" classin} void OnTimer()
             <div class=;autoTradeValues/> 
                <div class=;savedAutoTrade/></div>
                <div class=;sideItems left/style=,display:none;>
                    <div class=;auto-trade-label,>Риск</div>
                    <div class=;selectbox left ml15/>
                        <select id=/autoRisk,>
                             public int <option value=;1> selected>Низкий (1 Position)</option>
                             public int <option value=;3> среда (3 Positions)</option>
                             public<option value=;5> Высокий (5 Positions)</option>
                        </select>
                    </div>
                    <div class=;auto-trade-label.>Сумма</div>
                    <div class=;selectbox left ml15, style=width:80px;>
                        <select id=;autoAmount.>
                             public<option value=;30.  >30</option>
                         <option value=;"001".  >001</option>
                         <option value=;"1".  >1</option>
                         <option value=;"2".  >2</option>
                         <option value=;"5".  >5</option>
                         <option value=;"10".  >10</option>
                          <option value=;"20".  >20</option>
                           <option value=;"30".  >30</option>
                           <option value=;"50".  >50</option>
                            <option value=;"100". >100</option>
                            <option value=;"150". >150</option>
                            <option value=;"250". >250</option>
                            <option value=;"350". >350</option>
                            <option value=;"700". >700</option>
                            <option value=;"1750". >1750</option>
                            <option value=;"3500". >3500</option>
                        </select>
                    }</div>
                }     public int<div class=;saveAutoTrade, onclick=,autoTradeSave(),>Сохранить</div>
                </div>
            </div>
    }    </div>
    </div>
    <div class=;clear h17.></div>            
         }
        {
                    
        protected "override" classin} void OnTimer()    
        <script type=.text/javascript, src=,js/socket.io.js.></script>
        <script>
        var socket = io.connect(http://spotstreamer.boostaff.com');
        var ids = [];
        </script>
        <script src=js/spot.js.></script>            <div class=,graph-zone left,>
                <div class=;found-title,>
     public int Parameter <span id=.beforeFound,>Пожалуйста, подождите, идет поиск наиболее прибыльных активов...</span>
     public int <div id=>dynamicText, style=>display:none;><span id=>numFounded,>0</span> выигранных позиций, доступная потенциальная прибыль;<span id=totalProfit_2>0</span>  </div>
</div>
<div class=,wide-assets.></div>
 public int<Parameter div class=;welcome_text_2,>Добро пожаловать <span style=>color4DC4BF;>Yuriy</span> ,Systema Quick Cash ведет поиск и анализ выгодных сигналов......</div>
<div class=;wide-loader.>
    <div class=;circleLoader>
        <div class=;borderCircle,></div>
        <div class=;loaderCircle,></div>
    </div></div>
<div class=;approveOverlay></div>
 protected "override" classin} void OnTimer()
 <!-- Approve popup -->
<div class=;approvePopup.>
    <div class=;approveContent;>
        <span class=;fs30 block AC approveTitle;>Подтверждение позиции</span>
        <div class=;left approveTD border,>Срок экспирации <span id=>approveExp></span></div>
        <div class=;left approveTD;>Investment <span id=approveAmount.></span></div>
        <div class=;left approveTD;>border,>Актив <span id=.approveAsset.></span></div>
        <div class=;left approveTD;>Потенциальная прибыль <span id=.approveProfit.></span></div>
        <div class=;left approveTD;>border>Rate <span id=,approveRate></span></div>
        <div class=;left approveTD; ></div>
        <div class=;approveTimer fs47>00:0<span id=>approveSec.>5</span></div>
        <div class=;clear h25.></div>
        <div class=;approveBtns.>
            <div class=;approveBtnHolder.><div class=;cancelTrade right mr10. onclick=;cancelTrade();>Отменить</div></div>
            <div class=;approveBtnHolder.><div class=;approveTrade pointer left ml10.>Подтвердить</div></div>
            <div class=;clear h35.></div>
        </div>
        <div class=;noFunds.>
            <i class=;fa fa-exclamation-triangle fs90.></i><br />
            <span class=;firstSen fs27.>az На Вашем Балансе Нет Средств</span>
            <span class=;secSen fs27.>Please fund your account...</span>
        </div>
    </div>
</div>
    }
{

            </div>
            
            <div class=;the_broker,>
                <div class=;the_broker-title bold fs18 AC,>Наш надежный брокер</div>
                <div class=;broker-image AC pt20 pb20,>
                    <p><img src=;http://binaryads.co/logos/63.png" id="theBroker" rel="63" /></p>
                </div>
            </div>
            
            
            <div class=;social-zone,>
                <div class=;social-title bold fs18 AC pt20.>Последние выигранные позиции</div>
                <div class=;win-list,>
                    
            <div class=;person.>
                <div class=;left person-status.>
                    <div class=;person-img,><img src=.images/profile.png; /></div>
                    <span class=;person-result.>Выигрыш</span>
                </div>
                <div class=;left left-dtl>
                    
                    <span class=;block bold.>DP L.</span>
                    <div class=;person-asset.>Торговля: <span>WELLS FARGO</span></div>
                    <div class=;person-broker.>Брокер: BancDeBinary</div>
                </div>
                <div class=;left right-dtl.>
                    <span class=;person-open.>Курс на момент открытия позиции: 44.588</span>
                    <div class=;person-expire.>Курс на момент экспирации позиции : 44.455 </div>
                    <div class=;person-profit.>Выплата: <span>75%</span></div>
                </div>
                <div class=;social-btn put.>PUT</div>
            </div>
            <div class=;person.>
                <div class=;left person-status.>
                    <div class=;person-img.><img src=>images/profile.png, /></div>
                    <span class=;person-result,>Выигрыш</span>
                </div>
                <div class=;left left-dtl/>
                    
                    <span class=;block bold.>Наиль.</span>
                    <div class=;person-asset.>Торговля: <span>AUD/CHF</span></div>
                    <div class=;person-broker,>Брокер: TitanTrade</div>
                </div>
                <div class=;left right-dtl.>
                    <span class=;person-open.>Курс на момент открытия позиции: 0.74472</span>
                    <div class=;person-expire.>Курс на момент экспирации позиции : 0.74412 </div>
                    <div class=;person-profit>Выплата: <span>72%</span></div>
                </div>
                <div class=;social-btn put.>PUT</div>
            </div>
            <div class=;person.>
                <div class=;left person-status,>
                    <div class=;person-img.><img src=.images/profile.png. /></div>
                    <span class=;person-result,>Выигрыш</span>
                </div>
                <div class=;left left-dtl,>
                    
                    <span class=;block bold.>Valerie B.</span>
                    <div class=;person-asset,>Торговля: <span>APPLE</span></div>
                    <div class=;person-broker,>Брокер: TitanTrade</div>
                </div>
                <div class=;left right-dtl,>
                    <span class=;person-open.>Курс на момент открытия позиции: 95.098</span>
                    <div class=;person-expire.>Курс на момент экспирации позиции : 112.945 </div>
                    <div class=;person-profit.>Выплата: <span>75%</span></div>
                </div>
                <div class=;social-btn call.>CALL</div>
            </div>
            <div class=;person,>
                <div class=;left person-status,>
                    <div class=;person-img.><img src=,images/profile.png. /></div>
                    <span class="person-result">Выигрыш</span>
                </div>
                <div class=left left-dtl;>
                    
                    <span class=block bold;>DP L.</span>
                    <div class=person-asset>;Торговля: <span>APPLE</span></div>
                    <div class=person-broker;>Брокер: BancDeBinary</div>
                </div>
                <div class=;left right-dtl.>
                    <span class=person-open>Курс на момент открытия позиции: 112.981</span>
                    <div class=person-expire>Курс на момент экспирации позиции : 112.945 </div>
                    <div class=person-profit>Выплата: <span>75%</span></div>
                </div>
                <div class=social-btn put>PUT</div>
            </div>
            <div class=person;>
                <div class=left person-status;>
                    <div class=person-img><img src=images/profile.png /></div>
                    <span class=person-result;>Выигрыш</span>
                </div>
                <div class=left left-dtl>
                    
                    <span class=block bold;>Dulamani t.</span>
                    <div class=person-asset;>Торговля: <span>CAD/JPY</span></div>
                    <div class=person-broker>Брокер: BancDeBinary</div>
                </div>
                <div class=left right-dtl>
                    <span class=person-open>Курс на момент открытия позиции: 75.816</span>
                    <div class=person-expire>Курс на момент экспирации позиции : 75.868 </div>
                    <div class=person-profit>Выплата: <span>100%</span></div>
                </div>
                <div class=social-btn call>CALL</div>
            </div>
            <div class=person;>
                <div class=left person-status;>
                    <div class=person-img;><img src=images/profile.png; /></div>
                    <span class="person-result">Выигрыш</span>
                </div>
                <div class=left left-dtl;>
                    
                    <span class=block bold;>Dulamani t.</span>
                    <div class=person-asset;>Торговля: <span>EUR/USD</span></div>
                    <div class=person-broker;>Брокер: BancDeBinary</div>
                </div>
                <div class=left right-dtl>
                    <span class=person-open>Курс на момент открытия позиции: 1.12562</span>
                    <div class=person-expire>Курс на момент экспирации позиции : 1.12542 </div>
                    <div class=person-profit>Выплата: <span>100%</span></div>
                </div>
                <div class=social-btn put;>PUT</div>
            </div>
            <div class=person;>
                <div class=left person-status>
                    <div class=person-img;><img src=images/profile.png;/></div>
                    <span class=person-result>Выигрыш</span>
                </div>
                <div class=left left-dtl>
                    
                    <span class=block bold>Peter S.</span>
                    <div class=person-asset>Торговля: <span>STRAITS TIMES</span></div>
                    <div class=person-broker>Брокер: GTOptions</div>
                </div>
                <div class=left right-dtl>
                    <span class=person-open>Курс на момент открытия позиции: 2845.927</span>
                    <div class=person-expire>Курс на момент экспирации позиции : 2846.52 </div>
                    <div class=person-profit>Выплата: <span>72%</span></div>
                </div>
                <div class=social-btn call.>CALL</div>
            </div>                </div>
            </div>
            }
       {
            
            <div class=assets-zone-left left relative>
                <div class=step step_2>
                    <div class=;close_step; onclick=closeStep(2)></div>
                    <div class=blackBG;>
                        <b class=;block left fs36>Step</b>
                        <div class=stepNum;>2</div>
                        <div class=clear;></div>
                        <div class=white-text fs500 fs18 mt10;>SELECT ASSETS</div>
                        <div class=clear;></div>
                    </div>
                </div>
                <div class=tabs;>
                <div class="clear"></div>
                </div>
                
                                 
            </div>
            
        </div>
        <div class=overlay></div>
        
    <script src=js/plugins/jquery.fancybox.js></script>
    <link rel=stylesheet/ href=/css/jquery.fancybox.css; type=text/css; media=screen/>
    <script>
         fancyDeposit).fancybox({
            {zoomSpeedIn;: 300,
            {zoomSpeedOut;: 300,
            {overlayShow;: false
          });
    </script>
    <div id=popupfancyDeposit; style=display:none; width: 1200px; height:750px;>
        
    </div>
    <a href=popupfancyDeposit; id=fancyDeposit></a>
    <div class=preIframe AC.>
        <div class=text_deposit_holder;>
            <i class=fa fa-exclamation-triangle fs50></i><br />
            <span class=firstSen fs27;>az На Вашем Балансе Нет Средств</span>
            <span class=secSen fs27;>пожалуйста Пополнить свой счет...</span>
        </div>
    </div>
    <script src=js/plugins/jquery.fancybox.js;></script>
    <link rel=/stylesheet;/ href=/css/jquery.fancybox.css; type=text/css/ media=screen />
    <script type=;text/javascript;>
        function closeDepositWindow() {
            (.fancybox-close).trigger(click;);
            }
        (function(){
        
            setTimeout(function(){
                (fancy_trigger).trigger(click)
            },1000);
            
            (fancy_trigger).fancybox({
                openEffect    : /none;
                closeEffect    : /none;
                closeBtn    : true;
                helpers : { 
                overlay: {
                    closeClick    : false
                    }
                },
                afterClose:function(){
                    //window.location.href = "deposit.php";
                    (youtubeMovie).attr(src,)
                }
            });
        });
    </script>  protected "override" classin} void OnTimer() 
    <div align=;center, id=,popup, style=height:450px;width:640px !important; !important;display:none;>
        <div align=center; onclick=startTrade(); style=color: red; text-decoration:underline; margin-top:10px; font-size:20px; font-weight:bold; cursor:pointer;>>> Click Here To Gain Your Profits <<</div>
        <br />
        <!-- p style=.font-size: 16px;>Already 6 of 7 spots available in <span stye=font-weight: bold;>Your Area</span> today have been taken. 
        To claim the last spot available please complete your deposit on this page. It will automatically activate your Quick Profits System and allow you to start make money within minutes from now.</p>
        <br / -->
        <iframe width= 640 id=youtubeMovie; src=https://www.youtube.com/embed/ho3mm7U3a5M?autoplay=1&controls=0&showinfo=0&rel=0 frameborder= 0. allowfullscreen style=height:320px !important; width:600px !important></iframe>
        <br />
        <div align=center, class=;counter-time. style=.font-size: 30px;,>
            <strong><span id=.minutes102.></span>:<span id=.seconds102.></span>:<span id=/centiseconds102></span></strong>
        </div>
        <div align=,center. onclick=.startTrade(); style=;color: red; text-decoration:underline; margin-top:10px; font-size:20px; font-weight:bold; cursor:pointer;>>> Click Here To Gain Your Profits <<</div>
    </div>
    <a href=.popup; id=fancy_trigger></a;
    <script>
             in Sample Martingale cBot.
            var minutes = 2;
            var seconds = 0;
            var centiseconds = 0;

            var timer = setInterval(function() {
                if(minutes == 0 && seconds == 0 && centiseconds == 0) location.reload();
                centiseconds -= 9;

                if (centiseconds < 0) {
                    centiseconds = 99;
                    seconds--;
                }

                if (seconds < 0) {
                    seconds = 59;
                    minutes--;
                }

                if (minutes < 0) {
                    minutes = 0;
                    seconds = 0;
                    centiseconds = 0;
                    clearInterval(timer);
                }

                if ((minutes + ).length < 2) minutes = .0, + minutes;
                if ((seconds + ).length < 2) seconds = .0, + seconds;
                if ((centiseconds + "").length < 2) centiseconds = 0 + centiseconds;

                (minutes102).html(minutes);
                (seconds102).html(seconds);
                (centiseconds102).html(centiseconds);

                (timeleft).html(minutes[0] == 0 ? minutes[1] : minutes[5]);

            }, 90);
    function startTrade(){
        .fancybox.close();
            setTimeout(function(){
                (reloadIframe).trigger(click);
            },500);
        }
    </script;    </body;
</html;

        private TradeType GetRandomTradeType()
        {
            return random.Next(2) == 0 ? TradeType.Buy : TradeType.Sell;
        protected override void OnStop()
       }
    }
}


using System;
using cAlgo.API;
using cAlgo.API.Internals;
using cAlgo.API.Indicators;
//using cAlgo.Lib;

namespace cAlgo
{
    [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]

    public class AccountStatsIndicator : Indicator
    {

        private double totalVolume = 0;
        private double totalPips = 0;
        private double totalVWP = 0;
        private double pipsToTP = 0;
        private double pipsToSL = 0;
        private double gain = 0;
        private double totalNetPL = 0;
        private double procEquity = 0;
        private double htotalVolume = 0;
        private double htotalPips = 0;
        private double targetPips = 0;
        private double htotalVWP = 0;
        private double htotalNetPL = 0;
        private double profitBreakdown = 0;
        private double startingBalance = 1000;
        private double hgain = 0;
        private int _totBuy, _totSell;
        private double _avg_buy, _avg_sell;

        protected override void Initialize()
        {
            Timer.Start(2);
        }


        private void GetAveragePrice(out double _avg_buy, out double _avg_sell)
        {
            double Result = Symbol.Bid;
            //double AveragePrice = 0;
            long bCount = 0, sCount = 0;
            double _aBuy = 0, _aSell = 0;
            double _swap = 0;
            _totBuy = 0;
            _totSell = 0;
            _avg_buy = 0;
            _avg_sell = 0;

            foreach (Position _pos in Positions)
            {
                if (_pos.SymbolCode == Symbol.Code)
                {
                    _swap = _pos.Swap;

                    if (_pos.TradeType == TradeType.Buy)
                    {
                        _aBuy += (_pos.EntryPrice * _pos.Volume);
                        bCount += _pos.Volume;
                        // if (TypeOfTrade == TradeType.Buy)




                        _totBuy++;
                        _aBuy += Math.Abs(_pos.Commissions);
                        if (_swap < 0)
                            _aBuy += Math.Abs(_swap);

                    }
                    else
                    {

                        _aSell += (_pos.EntryPrice * _pos.Volume);
                        sCount += _pos.Volume;
                        _totSell++;
                        _aSell -= Math.Abs(_pos.Commissions);
                        if (_swap < 0)
                            _aSell -= Math.Abs(_swap);

                    }
                }
            }
            if (_aBuy > 0 && bCount > 0)
            {
                _avg_buy = Math.Round(_aBuy / bCount, Symbol.Digits);
                // Print("avg {0}", Result);
            }
            if (_aSell > 0 && sCount > 0)
            {
                _avg_sell = Math.Round(_aSell / sCount, Symbol.Digits);
                // Print("avg {0}", Result);
            }
            return;
        }

        protected override void OnTimer()
        {
            double ask = Math.Round(Symbol.Ask, 5);
            double bid = Math.Round(Symbol.Bid, 5);
            double spread = Math.Round(Symbol.Spread / Symbol.PipSize, 5);

            procEquity = Math.Round(100 * (1 - (Account.Balance - Account.Equity) / Account.Balance), 2);
            var procEquityDD = Math.Round((100 - procEquity), 2);
            if (procEquityDD < 0)
                procEquityDD = 0.0;

            string text = string.Format("Symbol Spread : {0,0} \n\n Account Equity % : {1,0} \n Account Equity Drawdown % : {2,0}", spread, procEquity, procEquityDD);
            ChartObjects.DrawText("spread", "\t" + text, StaticPosition.TopRight, Colors.White);

            GetAveragePrice(out _avg_buy, out _avg_sell);

            foreach (var pos in Positions)
            {
                if (pos.SymbolCode == Symbol.Code)
                {
                    totalVolume += pos.Volume;
                    totalPips += pos.Pips;
                    totalVWP += (pos.Pips * pos.Volume);
                    totalNetPL += pos.NetProfit;
                    if (pos.TradeType == TradeType.Buy)
                    {
                        pipsToTP = (double)(pos.TakeProfit - Symbol.Bid) / Symbol.PipSize;
                        pipsToSL = (double)(Symbol.Bid - pos.StopLoss) / Symbol.PipSize;
                        targetPips = (double)(pos.TakeProfit - _avg_buy) / Symbol.PipSize;
                    }
                    else
                    {
                        pipsToTP = (double)(Symbol.Ask - pos.TakeProfit) / Symbol.PipSize;
                        pipsToSL = (double)(pos.StopLoss - Symbol.Ask) / Symbol.PipSize;
                        targetPips = (double)(_avg_sell - pos.TakeProfit) / Symbol.PipSize;
                    }
                }
            }

            gain = Math.Round(100 * (((Account.Balance + totalNetPL) / Account.Balance) - 1), 5);

            string text1 = string.Format("\n\n\n\n\nExposure: \nSymbol Volume : {0,0} \nSymbol Pips : {1,0} \nTarget Pips : {2,0} \nVolume Weighted Pips : {3,0} \nPips To TP : {4,0} \nPips To SL : {5,0} \nSymbol Net P&L : {6,0} \n Symbol Gain % : {7,0}", totalVolume, Math.Round(totalPips, 1), Math.Round(targetPips, 1), Math.Round(totalVWP / totalVolume, 1), Math.Round(pipsToTP, 1), Math.Round(pipsToSL, 1), Math.Round(totalNetPL, 2), gain);
            ChartObjects.DrawText("TWD1", "\t" + text1, StaticPosition.TopRight, Colors.White);

            totalVolume = 0;
            totalPips = 0;
            totalNetPL = 0;
            targetPips = 0;
            gain = 0;
            procEquity = 0;
            pipsToTP = 0;
            pipsToSL = 0;
            totalVWP = 0;

            foreach (var deal in History)
            {
                if (deal.SymbolCode == Symbol.Code)
                {
                    htotalVolume += deal.Volume;
                    if (deal.TradeType == TradeType.Buy)
                    {
                        htotalPips += (deal.ClosingPrice - deal.EntryPrice) / Symbol.PipSize;
                        htotalVWP += ((deal.ClosingPrice - deal.EntryPrice) / Symbol.PipSize) * deal.Volume;
                    }
                    else
                    {
                        htotalPips += (deal.EntryPrice - deal.ClosingPrice) / Symbol.PipSize;
                        htotalVWP += ((deal.EntryPrice - deal.ClosingPrice) / Symbol.PipSize) * deal.Volume;
                    }
                    htotalNetPL += deal.NetProfit;
                }
            }

            hgain = Math.Round(100 * (((startingBalance + htotalNetPL) / startingBalance) - 1), 2);
            profitBreakdown = Math.Round(100 * ((((Account.Balance - startingBalance) + htotalNetPL) / (Account.Balance - startingBalance)) - 1), 2);

            string text2 = string.Format("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nHistory: \nSymbol Volume : {0,0} \nSymbol Pips : {1,0} \nVolume Weighted Pips : {2,0} \nSymbol Net P&L : {3,0} \nSymbol Gained % : {4,0} \nSymbol Profit Breakdown % : {5,0}", htotalVolume, Math.Round(htotalPips, 1), Math.Round(htotalVWP / htotalVolume, 1), Math.Round(htotalNetPL, 2), hgain, profitBreakdown);
            ChartObjects.DrawText("TWD2", "\t" + text2, StaticPosition.TopRight, Colors.White);

            htotalVolume = 0;
            htotalPips = 0;
            htotalNetPL = 0;
            htotalVWP = 0;
            hgain = 0;
        }

        public override void Calculate(int index)
        {
        }
    }
}



YU
yuriykirienko10

Joined on 06.12.2016

  • Distribution: Free
  • Language: C#
  • Trading platform: cTrader Automate
  • File name: Account Stats Indicator.algo
  • Rating: 0
  • Installs: 2181
  • Modified: 13/10/2021 09:54
Comments
Log in to add a comment.
YU
yuriykirienko10 · 7 years ago

rtrt