Forex Factory (https://www.forexfactory.com/forum.php)
-   Platform Tech (https://www.forexfactory.com/forumdisplay.php?f=69)
-   -   Coding robots and indicators in C# for no charge (cTrader API) (https://www.forexfactory.com/showthread.php?t=475718)

Alex Fly Mar 17, 2014 8:58am | Post# 1

Coding robots and indicators in C# for no charge (cTrader API)
 
In order to practice in C# programing I will code robots and indicators for everyone who request it in this thread. There are two conditions:

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

So everybody is welcome!

RedLineFred Mar 17, 2014 10:46pm | Post# 2

Hi Alex,
Do you see a future where MT4 is no longer?
I too have toyed with the idea of moving platforms, but not sure of the broker uptake.
On a seperate note, do you have any experience with programming DLLs? Now this is something I would like to explore. Any clues on where to get started?
Fred

Alex Fly Mar 18, 2014 3:22am | Post# 3

Hi Alex, Do you see a future where MT4 is no longer? I too have toyed with the idea of moving platforms, but not sure of the broker uptake. On a seperate note, do you have any experience with programming DLLs? Now this is something I would like to explore. Any clues on where to get started? Fred
You need to use some professional programming tools to compose dlls, for example Visual Studio. And you also have to have some experience in programming. If you do DLLs for cTrader you use the same language - C#. I like C#, that's why use it to develop robots and indicators.

As for MetaTrader - I don't know. Many people use it, but I wouldn't say that I like it so much.

Motion Mar 19, 2014 10:06am | Post# 4

Hi Alex, Do you see a future where MT4 is no longer? I too have toyed with the idea of moving platforms, but not sure of the broker uptake. On a seperate note, do you have any experience with programming DLLs? Now this is something I would like to explore. Any clues on where to get started? Fred
Well, coding DLLs in MT4 requires proficiency in C++. Try exploring it, the reward is great. As methods processed by DLLs are way way faster than methods processed within the MQL environment.

Just thought to respond as a fellow coder.

Regards,
Motion

Coley Mar 22, 2014 1:36am | Post# 5

Hi Alex Fly,

I have a trading strategy with screenshot examples ready for coding and have been seeking a C# programmer. I'd gladly take you up on your offer.

I was referred to your post by one of the devs at PFSoft who developed Protrader 3 - it is the most trader friendly platform around and has a lot of powerful functions. It is in C# with a MQL converter. I have put a lot of research into platforms over the last 6 months and Protrader 3 is unbelievable. I have also traded on cTrader so I can compare, and PT3 leaves it for dead.

FOK / IOC order types.

So if you'd be willing to program this Algo in C# for Protrader 3 I'd be extremely grateful. And I think you could also corner an emerging market for EA and Indis on this platform.

Coley

Viktor.kren Apr 16, 2014 12:52pm | Post# 6

2 Attachment(s)
Hey.
Please could someone help these two mq4 indicators remake for cTrader cAlgo Converter ?
On this web server is it free. I tried to do it myself but I have no chance to succeed.

http://2calgo.com/Home/Index#converted_indicator

Thank you so much !!!!!!!!!!!
1SSRC.mq4
3_Level_ZZ_Semafor.mq4

fxdaytrader_ Apr 16, 2014 1:03pm | Post# 7

2 Attachment(s)
I tried to do it myself but I have no chance to succeed. http://2calgo.com/Home/Index#converted_indicator Thank you so much !!!!!!!!!!! {file} {file}
attached the c-code as .txt-files. I have converted the indicators on the website
1SSRC.txt
3_Level_ZZ_Semafor.txt

Viktor.kren Apr 16, 2014 1:20pm | Post# 8

Hi fxdaytrader.
waw, thank you so much, you're too kind! That was fast!
I do not know how this format cTrader insert.
I can insert Indicator cTrader from this website. http://ctdn.com/algos/indicators
How I insert this format to CTrader please ?

Once again ,thank you very much!

fxdaytrader_ Apr 16, 2014 1:25pm | Post# 9

How I insert this format to CTrader please ?
I do not know and do not use cTrader but I think you should read the manual, google it, ...

Viktor.kren Apr 16, 2014 1:39pm | Post# 10

Oh, now I know what you mean.
But I do not know where to find cTrader editor, which I do put it
I'm sorry, but the manual is in English, I do not understand English.
That is, cooperation, I write a Google translator translated on the google.
So I apologize again for the question.
Thank you for your understanding.

vietrader May 21, 2014 10:54pm | Post# 11

Hi Alex,

I want to use a custom indicator to record Ctrader's spread into a text file. Can you code this indicator?

You can refer the spread recorder (MT4 version) here : http://www.forexfactory.com/showthread.php?t=195290

Thanks in advance.

Edorenta May 22, 2014 4:50am | Post# 12

Hi Alex!

That's great we see people moving onto cTrader which is from my point of view the best platform out there truly underestimated
I'm using both MT4 and cTrader on FxPro for manual trading, the main way I trade is quite simple and very efficient I described it on the MT4 post on which Fxdaytrader is very active but didn't answer me yet, (you can the post here with the eas I'm using http://www.forexfactory.com/showthre...45#post7480345)
if you were able to code such a cTrader API I would be infinately thanksful.

Quick shot at the strategy:

3 necessary conditions to buy:
-Osma (fast osma = 13; slow = 38; period = 8) slope has to be positive
-Trix (period = 3) has to be > 0
-Genesis matrix trend indicator has to have more than 3 positive criterias (I guess the problem here is that I didn't find a matrix of this kind so far on cTrader forums)

Reverse the conditions to sell.

tight SL to prevent fake signals
TP can be either in pips (large for TFs>M30) or the exit is triggered by a reversal of opening conditions

Just tell me what you think about it and if you think it would be possible to code such an api if yes I'd be glad to help you on the improvement steps
see ya!

dinofx Jun 8, 2014 6:14am | Post# 13

2 Attachment(s)
i really like that indi coded long time ago, but the drawing now fails with the recent mt4 release
Name:  roc.png
Views: 14698
Size:  15 KB ROC_Priliv_alert.mq4

fxdaytrader_ Jun 8, 2014 6:22am | Post# 14

1 Attachment(s)
I have added some more alert-methods (email, sound, popup, pushnotification) and renamed the indicator, but not sure if it works with the latest builds, pls. try
ROC_Priliv_alert mod.ex4

amarrkool Jun 27, 2014 4:09am | Post# 15

In order to practice in C# programing I will code robots and indicators for everyone who request it in this thread. There are two conditions: 1) Your robot/indicator must be well described here 2) Anyone on the forum can use it when it's implemented So everybody is welcome!

hi alex
i want to convert amibroker afl to mt4 can you code this reply to amarrkool@gmail.com

scalper.exp Jun 27, 2014 5:58am | Post# 16

Can some one create renko indicator for ctrader? Thanks in advance

Ben-Hur Jun 30, 2014 1:49pm | Post# 17

In order to practice in C# programing I will code robots and indicators for everyone who request it in this thread. There are two conditions: 1) Your robot/indicator must be well described here 2) Anyone on the forum can use it when it's implemented So everybody is welcome!
Are you still available?

L0pg Jul 2, 2014 7:49pm | Post# 18

1 Attachment(s)
Can you add a few features to this existing bot? I'll admit I have no programming skills to speak of..

Adding in a break even setting (similar to the default BE feature) so you can set when it goes into effect, and (if any) how many additional pips to add to BE, I.E. break even +1 pip, +2 etc..

Maximum spread that it will allow before cancelling pending orders would also be a great help, that way you can have it cut off if the spread widens beyond what you are comfortable with.

The ability to use 1000 as a lot size, currently you cannot do this, I do not know why.

And last but not least, an auto scaling of lot size based on % at risk. So you can choose a fixed lot size or an automatic calculation of risk. I'm not sure if you can even code this in.

If you can add these in you would make this a MUCH better file!
News Robot.rar

moneyflow21 Jul 3, 2014 5:01am | Post# 19

Hi Alex,

The best indicator that you can code or translate that would help everyone who uses cTrader are tools like a real time Currency Strength Meter [of all 8 individual major currencies in histogram form similar to the xMeter indicator for MT4], a real time Currency Strength Meter [of all 8 individual major currencies in line form similar to the CCFp indicator for MT4] or make a Dashboard that displays both the strength/weakness of all 8 majors individually AND show the strength/weakness of Pairs with the direction they are moving in real time.

And allow the ability to customize the colors, with added sound or e-mail alerts when specific currencies or pairs reach a user-defined level of strength/weakness if this is at all possible to do inside of cTrader. It would also be a good idea to also display the strength/weakness of Gold, Silver and Oil as well.

I hope it can be done!

jud500 Jul 3, 2014 11:13am | Post# 20

2 Attachment(s)
Hi Alex,

Your offer is appreciated.
Could you please code the following system into both an indicator alert and a separate EA. I have attached 2 excel files that provide a full description of both. They are the same system, the indicator would simply create some form of an alert that the trade should be taken, while the EA would also execute, manage and exit the trade when the trade setup arises.

I have been as detailed as I can for clarity sake. Let me know if you require any further info - I would be happy to discuss it with you on skype if required.

Kind regards
Jud
Conti Indicator.xlsx
Conti EA.xlsx

Ariful Mamun Jul 7, 2014 12:07pm | Post# 21

1 Attachment(s)
Hi,
Can anyone built the following indi or script based on yesterday candle?
Regards
Click to Enlarge

Name: vzone.jpg
Size: 79 KB

thegatan Jul 10, 2014 11:27pm | Post# 22

could any body help me? go this link http://www.forexfactory.com/showthre...49#post7596349

mahimahi Aug 15, 2014 3:53pm | Post# 23

http://2calgo.com/

awesome!

megamemo Oct 27, 2014 11:25pm | Post# 24

hi man !! first of all thanks for this thread (im sorry for my lack of inglesh my native is spanish)
there is no chance for you to pass the amazing ea for the ctrader thats an awesome ea but i will
or if you cut change some of the features of this one?:-)

i was wondering if there is no chance for you to added the feature of shoot alot of pending orders until the server sent a receipt back? and thet too for the sl( i think that shut help alot with the slipage and if anything that you may think to help them better against the slippage please dont hesitate in put it !! really and a newbiie about news but i want to test it but i love the ctrader really thanks alot in advanced have a nice day!!







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 == null) return;

// Trailing
if(position.TradeType == TradeType.Sell)
{
double distance = position.EntryPrice - Symbol.Ask;

if (distance >= Trigger * Symbol.PipSize)
{
double newStopLossPrice = Symbol.Ask + TrailingStop * Symbol.PipSize;
if (position.StopLoss == null || newStopLossPrice < position.StopLoss)
{
Trade.ModifyPosition(position, newStopLossPrice, position.TakeProfit);
}
}

}
else
{
double distance = Symbol.Bid - position.EntryPrice;

if (distance >= Trigger * Symbol.PipSize)
{
double newStopLossPrice = Symbol.Bid - TrailingStop * Symbol.PipSize;
if (position.StopLoss == null || newStopLossPrice > 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 <= triggerTime && (triggerTime - Server.Time).TotalSeconds <= SecondsBefore)
{
_ordersCreated = true;
DateTime expirationTime = triggerTime.AddSeconds(SecondsTimeout);

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

double 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(Position openedPosition)
{
position = openedPosition;
if (Oco == 1)
{
Trade.DeletePendingOrder(_buyOrder);
Trade.DeletePendingOrder(_sellOrder);
_ordersCreated = false;
}
}

protected override void OnPositionClosed(Position closedPosition)
{
position = null;
}
}
}

sansemotions Nov 7, 2014 8:57am | Post# 25

1 Attachment(s)
Hi All,
I just joined this forum. I would like to see if traders can provide feedback on the attached UI that I built along with many automated strategies[you name it]. It can be part of it. Currently, this UI can run along with Ninja Trader, however, I am working on bringing the similar UI for other platforms.
The red buttons are for sale(or short sell) and the green buttons are buy(or cover). The clicks to any of the buttons places orders on Ninja Traders Chart.
Click to Enlarge

Name: SansEmotionsApp.png
Size: 70 KB
Please send me your feed back if any of you think this can help the little guys.

Jns Jan 19, 2015 1:54am | Post# 26

Anyone willing to see if it will be possible to create an EA/ Trade manager. any clarification required please PM me. More screen shots available

Sell Entry
Rule 1: Price closed over the 7SMA Low --(Adjustable for future changes full range)
Rule 2: RSI 10 Median Price (HL/2) cross below 50 --(Adjustable for future changes full range)
Stop is placed 1 candle back from current candle XX pips above the 7SMA High (Buffer) --(Adjustable for future changes)

Buy Entry
Rule 1: Price closed over the 7SMA High --(Adjustable for future changes full range)
Rule 2: RSI 10 Median Price (HL/2) cross above 50 --(Adjustable for future changes full range)
Stop is placed 1 candle back from current candle XX pips below the 7SMA High (Buffer) --(Adjustable for future changes)

What I'm looking for is:

Option to set as a trade manager or to trade auto

Trade manager if trade is placed manually EA to place stop and TP as per settings.
If manual suggested trade size for position to display.
Place missing TP_X Pips - Yes/No
Place Missing SL_X Pips - Yes/No

If trade is set to Auto trade, trade size to be based on risk selected. Option to verify entry with email alert prior to placing entry.
Risk - 0.5% of equity -- Size of position calculated based on percentage risk and auto adjusted as account grows.

Options to take profit and size of position. ( Maybe only two TP and remainder to follow on the trailing stop as selected 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 as per trailing stop selection below.

Capital protection = True
NoLoss after_X pips

Trailing Stop options:
Trail only 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 below/ above Candle) - auto adjusting based on the the type of entry Buy or Sell

Option 2. (if Sell, Stop to follow above the SMA Low, If Buy Stop to follow below the SMA High)
Trail MA
Trail only in profit=True
MA Period
MA Type
MA Price
MA Shift (Candles behind current candle on MA)
Buffer (pips below/ above MA) - auto adjusting based on the the type of entry Buy or Sell

Option to display trade progression on screen.
Show_Status = true; // Show status of trade management in action
shift X = 10;
shift Y = 15;
Window Num = 0;
Window Corner = 1;
Status_Font = "Arial";
Status_Font_Size = 9;
Status_Color = Gray;
Option to have the trade trail in loss or only once in profit.
Attached Image (click to enlarge)
http://www.forexfactory.com/attachme...1&d=1421580152

rvkiran Jan 21, 2015 6:46am | Post# 27

hi Alex,
Are you able to develop for MT4,
I need one Robot for MT4. If you are ready to help, I will post the requirements.

Thanks in advance.

regards,
Kiran Kumar

sam77 Feb 7, 2015 7:28am | Post# 28

In order to practice in C# programing I will code robots and indicators for everyone who request it in this thread. There are two conditions: 1) Your robot/indicator must be well described here 2) Anyone on the forum can use it when it's implemented So everybody is welcome!

could you please give a robot .which is automatically put sl and tp.....with 20 or 50 pips.... when i manually input my trade.

modanetfx Apr 10, 2015 7:13am | Post# 29

1 Attachment(s)
can anybody help me to input ALARM to this indicator? i have tried it, but it stopped working.
SHI-SIGNAL.mq4

praveen1112 Apr 14, 2015 2:44am | Post# 30

2 Attachment(s)
Hi All,

I need help from anyone who knows a bit of coding in MT4

I want to back test a strategy, for which i need to create a customer indicator

Indicator that i want to create will be a combination of "Semafor" custom indicator and the bullish or bearish candle stick. Basically a sound and email alert when the price makes a "Bullish-Level 3 Semafor" and a "Bearish-Level 3 Semafor"


Anyone who can help me with this, would be appreciated

Attached are the examples of bullish and bearish semafor cases

I can be reached at praveen1112@gmail.com



Regards,

Praveen
Click to Enlarge

Name: Bullish level 3 semafor.png
Size: 48 KB
Click to Enlarge

Name: Bearish level 3 semafor.png
Size: 47 KB

denisio Jul 10, 2015 9:01am | Post# 31

Hi there guys/gals,

I have been trying to convert the Sonic R System from MT4 to cTrader for a few weeks now without any kind of success.... I am no good in c# and my timing is limited, right now i am using two different platform to convert the indicator. Anyone here able to assist me with this?

(I have already tried 2calgo.com)

Thanks in advance and I wish you all many pips and even more happy & healthy days.

Lyall Jul 23, 2015 5:40pm | Post# 32

I want an EA that will place a pending order on the London and New York open.
I would like to be able to decide before the open if I want a buy order or a sell order then the moment the clock clicks over the order is placed.
The pending order is ten pips above or below the open with a twenty pip take profit and a twenty pip stop loss but with a ten pip trailing stop.
Sounds simple but I wouldn't have a clue about coding things.
Thank you.

MerlinBrasil Jul 25, 2015 4:56am | Post# 33

2 Attachment(s)
Hi, and thanks for your kind offer.

One nice indi missing from cTrader is ZUP. I've attatched two versions, neither of which 2calgo.com would handle.

Can you manage the conversion?

Thanks again,
Merlin
ZUP_v80.rar
ZUPp_148.mq4

MerlinBrasil Jul 25, 2015 11:12am | Post# 34

Sadly, I think this thread is dead. According to his profile, Alex hasn't logged on since 19 Nov 2014.

Pity..... it was a nice idea and offer

azam0101 Jul 30, 2015 3:21am | Post# 35

Hi Alex, Do you see a future where MT4 is no longer? I too have toyed with the idea of moving platforms, but not sure of the broker uptake. On a seperate note, do you have any experience with programming DLLs? Now this is something I would like to explore. Any clues on where to get started? Fred

Hi alex,
I want to Ea this like EA. Which name res rose EA. IT is fine mql5.com-market. Pls see it nad reply me.
Azam

wolfsch Aug 1, 2015 11:24am | Post# 36

2 Attachment(s)
In order to practice in C# programing I will code robots and indicators for everyone who request it in this thread. There are two conditions: 1) Your robot/indicator must be well described here 2) Anyone on the forum can use it when it's implemented So everybody is welcome!
Hi Alex
I like to trade the volume because volume precedes price!
Now my Weiswave3 indicator does a good job but could be enhanced as described on the attached chart. It give very good hints for the price to turn the direction!
It would be great if you could look after the necessary changes to better read the volume and delete the unnessary lines on the chart.
I add the free indi for all who are interested and the description on the attached chart.Attachment 1724500,
Click to Enlarge

Name: WS30M5.png
Size: 100 KB

forexaz Aug 1, 2015 11:53am | Post# 37

1 Attachment(s)
{quote} Hi Alex I like to trade the volume because volume precedes price! Now my Weiswave3 indicator does a good job but could be enhanced as described on the attached chart. It give very good hints for the price to turn the direction! It would be great if you could look after the necessary changes to better read the volume and delete the unnessary lines on the chart. I add the free indi for all who are interested and the description on the attached chart.{file}, {image}
I found this version online it seems more accurate on my offline charts....still has all those lines though WeisWave3.mq4

mohitkr Aug 3, 2015 10:57am | Post# 38

Hello.
Any body can make Ea with this straegy


amazing hedge strategy market go anywhere you still in profit
suppose for euro/usd

buy @ 1.5500 (any price you can buy) lots 0.10
same time place two pending order
1. buystop @ 1.5510 lots 0.10
2. sellstop @ 1.5490 lots 0.10

if first order move 10 pips take it dont be greedy
unlucky your first order move in negetive zone, then your sell stop automatically trigger @ 1.5490 and your margin will be zero

as soon as your sell order will trigger @ 1.5490, you have to place immidiately again 2 pending order corresponding with you current position
1. buystop @ 1.5500 lots 0.10
2. sellstop @ 1.5480 lots 0.10
and delete the privious pending order buystop @ 1.5510

if the price move 1.5480 our sellstop will trigger immidiately, again the same routine to follow 2 pending order corresponding with you current position
1. buystop @ 1.5490 lots 0.10
2. sellstop @ 1.5470 lots 0.10
and delete the privious pending order buystop @ 1.5500

do this until you got 20 pips profit overall

as soon as our 20 pips profit reach close all order and delete pending order

then what,

we got our 20 pips, start again the cycle for first order 10 pips or multiple order 20 pips profits

you need $ 1000 and required 20 pips in london session and 20 pips in US session

mean daily 40 pips x 22 days = 880

jimtang Aug 4, 2015 12:48pm | Post# 39

2 Attachment(s)
Hello Alex

I am looking for a Bollinger Band Indicator.
Settings are Period 20
Deviations 2.5
Shift 0
Apply to close

When current candle closes above upper bollinger band or closes below lower bollinger band,
then arrow with alarm.
BB Break 2.mq4 is an example MT4 indicator but I would like C++ format.

The idea is reversal trading. Place a trade in the opposite direction.
Attached example from MT4 chart.
Thanks
BB Break 2.mq4
Click to Enlarge

Name: eurusd-m1-forex-capital-markets-5.png
Size: 54 KB

ghibellino Aug 22, 2015 4:38pm | Post# 40

3 Attachment(s)
hello colleagues traders, some of you are capable of encoding a few indicators in c # to cTrader?
I'd like to see how they work these three indicators in this platform

Thanks to all, and to those who can help me
kingpips01.mq4
Parabolic SAR of ma mtf.mq4
PipKey.mq4


© Forex Factory