Coding robots and indicators in C# for no charge (cTrader API)
Page 1 of 619 123 ... LastLast
Results 1 to 10 of 81

Thread: Coding robots and indicators in C# for no charge (cTrader API)

  1. #1
    In order to practice in C# programing I'll code robots and indiors for everybody who ask it in this thread. There are two states:

    1) Your robot/indior must be well described here
    2) Anyone on the forum may use it when it's implemented

    So everybody is welcome!

  2. #2
    Hello,
    Can anybody assembled the following indi or script based on yesterday candle?
    Regards

  3. #3

  4. #4

  5. #5
    hi man !! First of all thanks to this thread (im sorry for my absence of inglesh my native is spanish)
    there's absolutely no chance that you pass the wonderful ea for your ctrader theres an wonderful ea but will
    or if you reduce change some of the features of this ? :--RRB-

    I was wondering if there's absolutely no chance that you added the feature of shoot alot of pending orders until the server sent a receipt back? And thet too for the sl( I believe that closed help alot with all the slipage and if anything which you might think to help them better against the slippage please dont hesitate to place it!! Really and a newbiie about news but I want to test it I love the ctrader really thanks alot in advanced have







    Using System;
    using cAlgo.API;

    namespace cAlgo.Robots

    [Robot(AccessRights = AccessRights.None)]
    public class TradingNewsRobot: Robot

    private PendingOrder _buyOrder;
    private bool _ordersCreated;
    private PendingOrder _sellOrder;
    private Position position;

    [Parameter(News Day (1-5), DefaultValue = 1, MinValue = 1, MaxValue = 5)]
    public int NewsDay get; set;

    [Parameter(News Hour, DefaultValue = 14, MinValue = 0, MaxValue = 23)]
    public int NewsHour get; set;

    [Parameter(News Minute, DefaultValue = 30, MinValue = 0, MaxValue = 59)]
    public int NewsMinute get; set;

    [Parameter(Pips away, DefaultValue = 10)]
    public int PipsAway get; set;

    [Parameter(Take Profit, DefaultValue = 50)]
    public int TakeProfit get; set;

    [Parameter(Stop Loss, DefaultValue = 10)]
    public int StopLoss get; set;

    [Parameter(Volume, DefaultValue = 100000, MinValue = 10000)]
    public int Volume get; set;

    [Parameter(Seconds Before, DefaultValue = 5, MinValue = 1)]
    public int SecondsBefore get; set;

    [Parameter(Seconds Timeout, DefaultValue = 10, MinValue = 1)]
    public int SecondsTimeout get; set;

    [Parameter(One Cancels Other, DefaultValue = 1, MinValue = 0, MaxValue = 1)]
    public int Oco get; set;

    [Parameter(Trigger (pips), DefaultValue = 20)]
    public int Trigger get; set;

    [Parameter(Trailing Stop (pips), DefaultValue = 10)]
    public int TrailingStop get; set;


    protected override void OnStart()

    MarketData.GetMarketDepth(Symbol).Updated = MarketDepth_Updated;


    protected override void OnTick()

    if (position == ) return;

    // Trailing
    if(position.TradeType == TradeType.Sell)

    double distance = position.EntryPrice - Symbol.Ask;

    if (distance gt;= Trigger * Symbol.PipSize)

    double newStopLossPrice = Symbol.Ask TrailingStop * Symbol.PipSize;
    if (position.StopLoss ==


    else

    double distance = Symbol.Bid - position.EntryPrice;

    if (distance gt;= Trigger * Symbol.PipSize)
    newStopLossPrice gt; position.StopLoss)

    Trade.ModifyPosition(position, newStopLossPrice, position.TakeProfit);






    private void MarketDepth_Updated()

    if ((int) Server.Time.DayOfWeek == NewsDay ! _ordersCreated)

    var triggerTime = new DateTime(Server.Time.Year, Server.Time.Month, Server.Time.Day, NewsHour,
    NewsMinute, 0);

    if (Server.Time lt;= triggerTime (triggerTime - Server.Time).TotalSeconds lt;= SecondsBefore)

    _ordersCreated = true;
    DateTime expirationTime = triggerTime.AddSeconds(SecondsTimeout);

    dual sellOrderTargetPrice = Symbol.Bid - PipsAway*Symbol.PipSize;
    Trade.CreateSellStopOrder(Symbol, Volume, sellOrderTargetPrice,
    sellOrderTargetPrice StopLoss*Symbol.PipSize,
    sellOrderTargetPrice - TakeProfit*Symbol.PipSize, expirationTime);

    dual buyOrderTargetPrice = Symbol.Ask PipsAway*Symbol.PipSize;
    Trade.CreateBuyStopOrder(Symbol, Volume, buyOrderTargetPrice,
    buyOrderTargetPrice - StopLoss*Symbol.PipSize,
    buyOrderTargetPrice TakeProfit*Symbol.PipSize, expirationTime);




    protected override void OnPendingOrderCreated(PendingOrder newOrder)

    if (newOrder.TradeType == TradeType.Buy)
    _buyOrder = newOrder;
    else
    _sellOrder = newOrder;


    protected override void OnPositionOpened(Ranking openedPosition)

    standing = openedPosition;
    if (Oco == 1)

    Trade.DeletePendingOrder(_buyOrder);
    Trade.DeletePendingOrder(_sellOrder);
    _ordersCreated = false;



    protected override void OnPositionClosed(Ranking closedPosition)

    standing = ;



  6. #6
    Hi All,
    I just joined this forum. I'd love to see if traders can offer feedback on the attached UI which I constructed along with automated egies[you name it]. It can be a part of it. Currently, this UI can run along with Ninja Trader, but I am focusing on attracting the UI that is comparable for some other platforms.
    The red buttons are available (or short sell) and the green buttons are buy(or pay ). The clicks to any of the buttons puts orders on Ninja Traders Chart.

    Please send me your feed back in case any of you think this will help the small guys.

  7. #7
    Anyone. Any clarifiion needed please PM me. More screen shots accessible

    Sell Entry
    Rule 1: Price closed over the 7SMA Low --(Adjustable for future changes complete range)
    Rule 2: RSI 10 Median Price (HL/2) cross below 50 --(Adjustable for future changes complete range)
    Cease is put 1 candle straight from current candle XX pips over the 7SMA High (Buffer) --(Adjustable for future fluctuations )

    Buy Entry
    Rule 1: Price closed over the 7SMA High --(Adjustable for future changes complete range)
    Rule 2: RSI 10 Median Price (HL/2) cross over 50 --(Adjustable for future changes complete range)
    Cease is put 1 candle straight from current candle XX pips below the 7SMA High (Buffer) --(Adjustable for future adjustments )

    What I am looking for is:

    choice to set as a commerce supervisor or to exchange auto

    Trade manager if commerce is put manually EA to place stop and TP according to settings.
    If manual suggested trade size for place to exhibit.
    Position missing TP_X Pips - Yes/No
    Place Missing SL_X Pips - Yes/No

    When commerce is set to Auto transaction, commerce size to be predicated on risk chosen. Choice to verify entry with email alert.
    Risk - 0.5% of equity Size of position calculated based on percentage risk and auto adjusted as account develops.

    Choices to take profit and dimensions of position. ( Perhaps only two TP and remainder to follow about the trailing stop as chosen below)
    TP 1_X pips
    TP 1_X lots
    TP 2_X pips
    TP 2_X lots
    TP 3_X pips
    TP 3_X lots

    Remainder to continue to follow along according to trailing stop selection below.

    Capital protection = True
    NoLoss after_X pips

    Trailing Stop options:
    Trail Just in profit=True
    Manage Trade Time Frame=(M5,M15,M30,M60,M240,D1)
    Option 1.
    Trail Candle
    Trail behind candle_X Candles back from current candle
    Buffer_X Pips (pips under / over Candle) - auto adjusting based on the the Kind of entry Buy or Sell

    Choice 2. (if Sell, Cease to follow over the SMA Low, Should Buy Cease to follow below the SMA High)
    Trail MA
    Trail Just in profit=True
    MA Stage
    MA Type
    MA Price
    MA Alter (Candles behind current candle on MA)
    Buffer (pips below/ above MA) - auto adjusting determined by the the Kind of entry Buy or Sell

    Choice to display commerce advancement on screen.
    Show_Status = true; // Display status of commerce direction in action
    change X = 10;
    change Y = 15;
    Window Num = 0;
    Window Corner = 1;
    Status_Font = Arial;
    Status_Font_Size = 9;
    Status_Color = Gray;
    Choice to have the transaction path in reduction or only once in profit.
    Attached Image (click to enlarge)

  8. #8
    Hi Alex,
    Are you currently able to develop for MT4,
    I need a Robot for MT4. If you're ready to help, I will post the requirements.

    Thanks in advance.

    regards,
    Kiran Kumar

  9. #9
    Quote Originally Posted by ;
    In order to practice in C# programing I'll code robots and indiors for everybody who ask it in this thread. There are just two states: 1) Your robot/indior must be nicely described here 2) Anyone on the forum may use it if it's implemented So everybody is welcome!
    Could you please give a robot .which is automatically place sl and tp....with 20 or 50 pips.... When I input my transaction.

  10. #10
    can anyone help me to enter ALARM to this indior? It has been tried by me, but it stopped functioning.
    https://www.nigeriaforextrading.com/...1656506681.mq4

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
This website uses cookies
We use cookies to store session information to facilitate remembering your login information, to allow you to save website preferences, to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners.