### Info

 Username: progy85 Name: progy85 Member since: 07 Jan 2021

None

### Signature

None

@Dragon Gold EA 600% 1 year:  05 May 2021, 07:34

Hi, I have checked backtesting. 3k is not enough. Minimum request 5k. Try between&nbsp;01/03/2021 and&nbsp;05/05/2021

### Last Forum Posts

@How to martingale when is win:  20 Nov 2021, 12:08

Hi,

I have three win trades in a row.

if first trade is win with 0.01 lot

Second trade is win with 0.02 lot

Third trade is win with 0.04

Then start again from 0.01 if all three wins, but If is not win second or first then start from 0.01

I dont have idea how to do this

I hope you will help me.

@How to find and calculate the last 4 row from History:  18 Nov 2021, 10:06

amusleh said:

Hi,

To get last four lost trades net profit you can filter the lost trades first then order them, after that take the last four:

``````var result = History.Where(trade => trade.SymbolName.Equals(SymbolName, StringComparison.OrdinalIgnoreCase) && trade.NetProfit < 0).OrderByDescending(trade => trade.EntryTime).Take(4).Sum(trade => trade.NetProfit);
``````

thanks!!!

@How to find and calculate the last 4 row from History:  18 Nov 2021, 08:56

amusleh said:

Hi,

To get the last four values you can use OrderByDescending and Take, but on your posted sequence the values you are looking to get aren't last four.

You can first skip the last 2 values and then use Take to get the last 4 values:

``````var result = History.Where(trade => trade.SymbolName.Equals(SymbolName, StringComparison.OrdinalIgnoreCase)).OrderByDescending(trade => trade.EntryTime).Skip(2).Take(4).Sum(trade => trade.NetProfit);
``````

Hi,

problem is because I need to skip winnings and find last 4 lost.

If I have
win 50
win 100
win 30
lost 15
lost 13
lost 17
win 15
lost 8
lost 12
lost 15
lost 20

win 13

My results must be: 8+12+15+20= 55

Also is ok if use Count. What I need to do Is check if last four trade in a row are lost:
win

lost
win
win
win
lost
lost
lost
win
win
lost
lost
lost
lost

win

I hope you will help me. Thanks!

@How to find and calculate the last 4 row from History:  18 Nov 2021, 07:25

hi,

I want to calculate the last 4 row which is lost:

NetProfit:
50
100
-30
-50
20
-50
-70
-80
-100

74
-65
How can I get the last 4 NetProfit: -50-70-80-100=-300

`` var netProfit = History.Where(trade => trade.SymbolName == Symbol.Name).OrderByDescending(x => x.EntryTime).Take(4).Sum(trade => trade.NetProfit);``

Thank you.

@How to open trade on new york time:  08 Oct 2021, 22:07

hello,

i want to open first trade on new york time but if I used:

if (Server.Time.Hour >= 12 && Server.Time.Hour < 12 + 2)

robot stopped

I used onstart and ontick

@How to count RSI touching:  30 Sep 2021, 14:31

Hello,

This is sample. Instead of using buy or sell, I need to calculate Print when touch 80 and 20 always when touch line for specific period. Example:
RSI TOUCH 80: 5 times
RSI TOUCH 20: 15 times

How to do this?

// -------------------------------------------------------------------------------------------------
//
//    This code is a cTrader Automate API example.
//
//    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.
//
//    All changes to this file might be lost on the next application update.
//    If you are going to modify this file please make a copy using the "Duplicate" command.
//
//    The "Sample RSI cBot" will create a buy order when the Relative Strength Index indicator crosses the  level 30,
//    and a Sell order when the RSI indicator crosses the level 70. The order is closed be either a Stop Loss, defined in
//    the "Stop Loss" parameter, or by the opposite RSI crossing signal (buy orders close when RSI crosses the 70 level
//    and sell orders are closed when RSI crosses the 30 level).
//
//    The cBot can generate only one Buy or Sell order at any given time.
//
// -------------------------------------------------------------------------------------------------

using System;
using System.Linq;
using cAlgo.API;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;
using cAlgo.Indicators;

namespace cAlgo
{
[Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
public class SampleRSIcBot : Robot
{
[Parameter("Quantity (Lots)", Group = "Volume", DefaultValue = 1, MinValue = 0.01, Step = 0.01)]
public double Quantity { get; set; }

[Parameter("Source", Group = "RSI")]
public DataSeries Source { get; set; }

[Parameter("Periods", Group = "RSI", DefaultValue = 6)]
public int Periods { get; set; }

private RelativeStrengthIndex rsi;

protected override void OnStart()
{
rsi = Indicators.RelativeStrengthIndex(Source, Periods);
}

protected override void OnTick()
{
if (rsi.Result.LastValue < 20)
{
}
else if (rsi.Result.LastValue > 80)
{
}
}

{
foreach (var position in Positions.FindAll("SampleRSI", SymbolName, tradeType))
ClosePosition(position);
}

{
var position = Positions.Find("SampleRSI", SymbolName, tradeType);
var volumeInUnits = Symbol.QuantityToVolumeInUnits(Quantity);

if (position == null)
ExecuteMarketOrder(tradeType, SymbolName, volumeInUnits, "SampleRSI", 45, 60);
}
}
}

@RSI alert under level 20:  09 Sep 2021, 08:17

Hello,

how can I get alert on email when is RSI:

Under 20

Thanks.

@Take NetProfit:  01 Jul 2021, 21:41

Hi,

I have 0.10 lot

TP is 20 pips

When reach 15 pips I need to take profit \$15 and after reach another 5 pips I need to take remaining amount \$5.
But lot size must be 0.10 always.

@Negative GrossProfit stop robot with closeposition:  30 Jun 2021, 18:39

Hi,

how can I closeposition and stop robot when GrossProfit is \$-10 ?

This code not works on OnTick ?

foreach (var position in Positions)
{
if (position.GrossProfit < -10)
{
ClosePosition(position);
Stop();
}
}

@How can I get info when pips go fast in wrong direction?:  22 Jun 2021, 06:35

hi,
my robot will place direction Sell and TP is 40 pips,

but between this time direction Buy go to direction and can reach 30 pips or more in one minute and I have big minus here.

I need to find solution how can I stop robot in this way.

Regards & thanks for your help.

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.