Topics
Replies
eynt
15 Jun 2021, 09:16
RE:
I've printed my leverage using the code below and got the following prints:
15/06/2021 09:09:06.933 | vol: 1000000000 lev: 50
15/06/2021 09:09:06.933 | vol: 250000000 lev: 100
15/06/2021 09:09:06.933 | vol: 200000000 lev: 500
Which is not what I expected to get. My Pepperstne account leverage is 1:500 regardless of volume.
foreach (LeverageTier a in Symbol.DynamicLeverage)
{
Print("vol: " + a.Volume + " lev: " + a.Leverage);
}
Thanks
@eynt
eynt
15 Jun 2021, 08:42
RE:
Thank you
I was able to access the account leverage by this.Account.PreciseLeverage. How can I access the SymbolInfo.DynamicLeverage property?
@eynt
eynt
04 Jun 2021, 16:37
RE:
PanagiotisCharalampous said:
Hi yuval.ein,
No this should not affect it. Probably the broker has disabled cTrader Copy.
Best Regards,
Panagiotis
I understand it means I cannot copy others while using my Pepperstone account. Can others copy me while I'm using Pepperstone?
Thanks
@eynt
eynt
20 Apr 2021, 15:21
RE:
I've tried the following but when I change the text in one of the files in the directory but nothing happens (no prints):
using System;
using cAlgo.API;
using cAlgo.API.Internals;
using cAlgo.API.Indicators;
using cAlgo.Indicators;
using System.IO;
namespace cAlgo
{
[Indicator(IsOverlay = false, TimeZone = TimeZones.UTC, AccessRights = AccessRights.FullAccess)]
public class NewIndicator : Indicator
{
[Output("Main")]
public IndicatorDataSeries Result { get; set; }
private FileSystemWatcher _watcher;
protected override void Initialize()
{
_watcher = new FileSystemWatcher(@"d:\temp\");
_watcher.NotifyFilter = NotifyFilters.Attributes
| NotifyFilters.CreationTime
| NotifyFilters.DirectoryName
| NotifyFilters.FileName
| NotifyFilters.LastAccess
| NotifyFilters.LastWrite
| NotifyFilters.Security
| NotifyFilters.Size;
_watcher.Changed += OnBlockFileChanged;
}
private void OnBlockFileChanged(object sender, FileSystemEventArgs e)
{
try
{
Print("OnBlockFileChanged " + e.ChangeType + " " + e.Name);
}
catch (Exception ex)
{
Print("error OnBlockFileChanged " + ex);
}
}
public override void Calculate(int index)
{
// Calculate value at specified index
// Result[index] = ...
}
}
}
@eynt
eynt
18 Apr 2021, 12:06
RE:
Hi
There's a problem with this approach:
Once the LoadMoreHistory (which was called by the first indicator) is finished, the secondary immediately calls the Calculate method, BEFORE the first indicator had the time to change the value in the file. Therefor, the Calculate method will not be called although it should have.
Thanks
@eynt
eynt
06 Apr 2021, 20:08
RE:
I've added a feature suggestion. Please vote for it on the following link:
cTDN Forum - Load more History on Backtest (ctrader.com)
@eynt
eynt
06 Apr 2021, 15:42
RE:
When I use ModifyStopLossPrice I don't see an order at the "Orders" tab nor at the PendingOrders property.
1. Is the SL placed internally on cTrader or at the broker?
2. Where can I see the SL order by code?
3. What happens if the cTrader app is restated, is the SL is kept or canceled?
Thanks
@eynt
eynt
02 Apr 2021, 13:00
RE:
I am not sure how to implement the Positions.Modified event in the context I was talking about.
the PositionModifiedEventArgs object only gives a Position object which does not give (to my understanding a state if the order was filled, cancelled, etc.
Perhaps you can give a small code example of how to know when a stop loss was filled after entering a position using ExecuteMarketOrder and placing its stop loss using ModifyStopLossPrice.
Thank you
@eynt
eynt
31 Mar 2021, 21:31
RE: RE: RE:
Of course it is useful. If I start running a back test from a specific date, I will need a certain amount of past data before that date. This amount (bars or days) is not always known and can be decided when starting the back test. For example, on the start of my cBot I will keep calling LoadMoreHistory until a specific condition is filled. The amount of times I will call the function (and as a result the bars count loaded) is not fixed and can be changed according to market conditions.
@eynt
eynt
15 Jun 2021, 20:24
RE:
Many symbols, such as EURNZD, GBPCAD, GBPCHF, EURUSD etc.
@eynt