odomike's avatar
Michael Ogbonnaya
Michael Ogbonnaya's avatar

Info

Username:odomike
Name:Michael Ogbonnaya
Member since: 15 Sep 2012
Country:Nigeria

Favorite symbols:

EURUSD, GBPUSD, EURJPY, AUDUSD, USDCHF, GBPJPY, NZDUSD

About

None

Signature

None

Last Algorithm Comments

@cMulti 2.1.0(Updated):  09 Apr 2017, 17:13


What's the order copying latency? Can this be used for HFT trading?

@Alembex:  07 Dec 2013, 11:24


I always keep getting this error: "Erreur de Volume" which I suppose means VOLUME ERROR. What could be causing this? Does it mean that your robot cannot trade on an account that it $1000 or less? I am even trying to backtest with 1K and still getting the same error.

@TradingNewsRobot with Trailing Stop Loss:  12 Jun 2013, 23:16


This is what I have been looking for. Thanks m8

@News Robot:  03 Dec 2012, 01:12


Thanks Zenner. Corrected and working properly now.

@News Robot:  20 Nov 2012, 00:06


I always get this error while the News bot is trying to place the buy stop order "YOUR REQUEST TO BUY STOP ORDER FOR 10K OF EURUSD WAS NOT SENT DUE TO TECHNICAL ERROR" What could be causing this? It places the Sell stop order successfully all the time though.

@News Robot:  19 Nov 2012, 16:11


This is what I have been waiting for so long. You really dont know how grateful I am to you for this robot. Time to start trading the news on my cAlgo. Thanks a million buddy :)

@Trend Indicator:  15 Sep 2012, 13:13


This seems like a promising trend indicator. I am gonna give it a try.

Last Forum Posts

@TECHNICAL ERROR WHEN ROBOT TRIES TO PLACE 2 PENDING STOP ORDERS:  21 Nov 2012, 18:25


I have to admit that I dont know anything about cAlgo programming. Admin, please help me with the specific code that can implement the spread checking in the news robot. So that if the spread exceeds a specific amount, it cancels the pending order. Please help me this one last time.

I appreciate all the help you have given me so far. Thanks a million fold.

~Michael.

@TECHNICAL ERROR WHEN ROBOT TRIES TO PLACE 2 PENDING STOP ORDERS:  21 Nov 2012, 18:01


Ok, thanks Admin. I will try to implement the Symbol Spread parameter in the Robot. Will that also control the automatic adjustment of the pending orders before News time? If there is any other problem, I will let you know.

Thank a lot.

~Michael.

@TECHNICAL ERROR WHEN ROBOT TRIES TO PLACE 2 PENDING STOP ORDERS:  21 Nov 2012, 13:45


Ok thank you som much Admin. It works perfectly now. I really appreciate your help, but I need another one. Please can you tell me what code I can integrate in the robot to enable it check for spread? For instance, my broker widens the spread just before News Release. I want the robot to be able to watch the spread and automatically readjust the pending orders, still maintaining the same dstance from the current market price, but it will stop adjusting at the News Time.

Example ...

News time = 11:00am

Robot places 2 pending stop orders by 10:59 and adjusts the pending orders to follow the market prices (Ask and Bid), still maintaining the same distance from the market prices and if the spread starts widening, it will also widen its pending orders to maintain distance. But it leaves the pending orders intact (stops adjusting) by exactly 11:00am.

Please let me know if this is achievable and what code I can use to achieve it.

Again, thank you so much for your super awesom support. I appreciate so much :)

~Michael.

@TECHNICAL ERROR WHEN ROBOT TRIES TO PLACE 2 PENDING STOP ORDERS:  20 Nov 2012, 11:36


How do I correct this please? I need the exact code that can make the necessary corrections so it can start working properly and place the 2 pending stop orders as required of the robot.

@TECHNICAL ERROR WHEN ROBOT TRIES TO PLACE 2 PENDING STOP ORDERS:  20 Nov 2012, 00:17


Hi Support,

I downloaded and am using the News Robot. I havent really had any issues with cAlgo till now. Each time I try to place 2 pending STOP ORDERS with the News Trader, it starts with placing the  SELL ORDER FIRST and this is always successful, but on trying to place the BUY ORDER, I always get this error

"YOUR REQUEST TO BUY STOP ORDER FOR 10K OF EURUSD WAS NOT SENT DUE TO TECHNICAL ERROR"


What could possibly be causing this and what can I do to resolve it? I am pasting the code for the robot so you can have a look and let me know what could be wrong and how I can correct this. I need this to worl perfectly.

Thank you in advance.

Michael.

N.B: Here is the code for the robot.

using System;
using cAlgo.API;
using cAlgo.API.Indicators;
using cAlgo.Indicators;

namespace cAlgo.Robots
{
    [Robot]
    public class NewsRobot : Robot        
    {
    	[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=1000)]
    	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; }
    	
    	private bool _ordersCreated;
    	private PendingOrder _buyOrder;
    	private PendingOrder _sellOrder;
    	    	
        protected override void OnTick()
        {        	
			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;					
					var expirationTime = triggerTime.AddSeconds(SecondsTimeout);
					
					var sellOrderTargetPrice = Symbol.Bid - PipsAway * Symbol.PipSize;					
					Trade.CreateSellStopOrder(Symbol, Volume, sellOrderTargetPrice,
						sellOrderTargetPrice + StopLoss * Symbol.PipSize, sellOrderTargetPrice - TakeProfit * Symbol.PipSize, expirationTime);	

					var buyOrderTargetPrice = Symbol.Ask + PipsAway * Symbol.PipSize;
					Trade.CreateBuyStopOrder(Symbol, Volume, buyOrderTargetPrice,
						buyOrderTargetPrice - StopLoss * Symbol.PipSize, buyOrderTargetPrice, expirationTime);
				}
			}
        }
        
		protected override void OnPendingOrderCreated(PendingOrder newOrder)
		{
			if (newOrder.TradeType == TradeType.Buy)
				_buyOrder = newOrder;
			else
				_sellOrder = newOrder;
		}
        
		protected override void OnPositionOpened(Position openedPosition)
		{
			if (Oco == 1)
			{
				Trade.DeletePendingOrder(_buyOrder);
				Trade.DeletePendingOrder(_sellOrder);
			}
		}        
    }
}



@How to code a news trading robot:  26 Oct 2012, 10:13


Yes Admin. The second question is in reference to the first one. I would have gladly editted the question if this forum has the edit feature. Sorry for my late reply.

@How to code a news trading robot:  13 Oct 2012, 16:00


If its possible to include the ability to place LIMIT orders too (Say you use PipsawaySTOP for gap from current price for pending STOP orders and PipsawayLIMIT for gap from current price for pending LIMIT orders ), that will be super fantastic.

This will really make lives easier for lots of us new traders.

Thank you in advance.

Michael.

@How to code a news trading robot:  13 Oct 2012, 15:47


Hi,

I am completely new to cAlgo development.  So i dont really know anything on the programming side. I am looking for the code for a robot that will automatically place a pending buy and pending sell at a given time with a specified lot size, etc. Underlisted are the required parameters ...

Pipsaway  = The number of pips away from the current market price where the pending buy and sell orders will be placed.

TP           = The Exact Amount Of the Pips u will get as the profit in your account

SL           = Stop Loss amount in pips

NDay       = News Day

NHour      = News Hour (broker's time)

NMin        = News Minute (Broker's time)

CTCBN     = Numbers Candles to check Before News For determining High & Lows , when it is 1 it check 2 candles the current candle and the 1 last one

SecBO     = Seconds Before News Which EA Will Place Pending Orders (In Secs)

SecBMO   = Seconds Before News Which EA Will Stop Modifying Orders (In Secs)

STWAN    = Seconds To Wait After News to Delete Pending Orders (In Secs)

OCO       = One Cancel The Other , will cancel the other pending order if one of them is hit (True/False)

BEPips     = Pips In profit which EA will Move SL to BE+1 after that

TrailingStop = Trailing Stop in pips

MM          = Money Management (True/False)

RiskPercent = Percentage of account equity to be risked in the trade

Lots         = Lot size to be use to execute the trade

When activated, robot should run in the background and only place the pending orders at the pre-defined time and date. And should show some kinda error if a wrong time and date is input in its parameter.

There is a similar EA on MT4 platform called Amazing EA. You will find it on this link http://www.forexfactory.com/showthread.php?t=6854. You can go through the code and possibly understand it better.

I dont know how possible it is to code this Robot. But I will be most grateful to any cBot developer out there that can code this robot. This will make my life and the lives of many other cAlgo users a lot easier.

Thank you in advance.

Michael.

@How to use Trailing stop in cTrader:  24 Sep 2012, 17:02


Ok admin. I wil be checking here regularly. I need trailing stop to start working fully on cTrader. I am actually in the process of completely dumping MetaTrader and switching to cTrader and without trailing stop, I cant complete my transition to cTrader.

Thank you.

@Trailing stop suggestion:  23 Sep 2012, 08:46


Please add the ability to use manual trailing stops in both cTrader and cAlgo. You know, like you can right click any trader in MT4/MT5 and choose/apply a trailing stop to it instantly. The fact that I can't use a trailing stop could mean that I loose every profit in my trades and probably end up with a loss. With trailing stops, I secure the profit and not loose out in the end.

Please consider adding this soonest possible. I wonder why it wasnt considered important in the first place.

Notification Publishing copyrighted material is strictly prohibited. If you believe there is copyrighted material in this section you may use the Copyright Infringement Notification form to submit a claim.

No uploaded.

Warning! Executing cBots downloaded from this section may result in loss of funds. Use them at your own risk.

No uploaded.