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)

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