Topics
Replies
firemyst
10 Jan 2021, 11:44
RE:
PanagiotisCharalampous said:
Hi EagleMoxy,
No it doesn't. You obfuscate dll files that can can be decompiled, just to make the life of the perpetrator a bit harder. There is no point to obfuscate encrypted files.
Best Regards,
Panagiotis
Two points for clarification/confirmation @Panagiotis:
1) Spotware hypothetically (more than likely) has the ability to decrypt files as most other brokers that have custom software that encrypts code also has the ability to decrypt it. So any calgo files can be decrypted by Spotware, correct?
2) Are the files also encrypted when compiled from within Visual Studio?
Thank you.
@firemyst
firemyst
08 Jan 2021, 02:46
RE:
PanagiotisCharalampous said:
Hi apon.ru.bd,
Unfortunately this information is not available in the HistoricalTrade class.
Best Regards,
Panagiotis
Just to clarify, the "reason" is available, but the actual stoploss/take-profit value isn't, correct @Panagiotis?
@apon.ru.bd, you said, "I need to check closing reason in tick method, not from positionClosing method."... so put the code in the OnTick method rather than the closing one.
That's a lot of extra CPU time wasted though checking the Historical Trade information on every tick.
Also, there is a way to get the stoploss value when a position is closed. Every time OnTick is called, save the current stoploss value in a global class variable; then in the PositionsClosed method check the value of it (as it should have the latest)
Rough code sample:
private double _lastSLValue = -1;
OnTickMethod( ... )
{
//whatever
//check to make sure you have a position
//you may also need to check if you have an SL if you don't always assign one
if (p != null)
_lastSLValue = p.StopLoss.GetValueOrDefault();
//whatever
}
PositionsClosedMethod ( ... )
{
//do whatever you need to with _lastSLValue
// more stuff
//reset the value if you need to
_lastSLValue = -1;
}
@firemyst
firemyst
07 Jan 2021, 15:14
RE: RE:
EagleMoxy said:
*( is there a way to get email notifications when a question is answered in the forum?)
Yes, there is.
You have to click the "Subscribe" button at the top of the page after you submit your response.
This forum doesn't automatically subscribe you to replies.
@firemyst
firemyst
07 Jan 2021, 15:13
private void OnPositionsClosed(PositionClosedEventArgs args)
{
Print("Closed");
var position = args.Position;
if (position.Label != "Martingale22" || position.SymbolName != SymbolName)
return;
//What kind of "delay" do you want?
//To wait x-milliseconds
Thread.Sleep(1000); //waits 1 second. You may have to import system.threading
if (position.GrossProfit > 0)
{
ExecuteOrder(InitialQuantity, TradeType.Buy);
}
}
@firemyst
firemyst
07 Jan 2021, 08:50
I suspect your error is on this line:
BB = Indicators.BollingerBands(wvf, bbl, mult, MovingAverageType.Simple);
wvf is not a "DataSeries" object; it's a "double".
That's the first parameter required when using that BollingerBands constructor is a DataSeries. For example, the close prices, high prices, low prices, open prices, etc.
@firemyst
firemyst
07 Jan 2021, 08:40
( Updated at: 07 Jan 2021, 08:42 )
Sample code to get such information:
Position p1 = args.Position;
//Now get the historical trade stuff.
HistoricalTrade ht = History.FindLast(p1.Label, p1.SymbolName, p1.TradeType);
if (ht != null)
{
double cp = ht.ClosingPrice;
Print("Position \"{0} {1}\" closed for reason {2} with {3} profit. Entry Price {4}, Closing Price {5}, StopLoss {6}", p1.Id, p1.Label, args.Reason, String.Format("{0:$#,###.00}", p1.GrossProfit), p1.EntryPrice, cp, p1.StopLoss);
}
The only other thing you'll have to do is narrow down the position(s) returned if you have multiple.
For example:
if (p1.SymbolName == Symbol.Name && p1.Label == thePositionLabel)
{ ... }
@firemyst
firemyst
26 Dec 2020, 16:29
RE: RE: RE:
vincenzo.dal.mare said:
firemyst said:
vincenzo.dal.mare said:
Hello guys,
how can i enter the jurik moving average?
in the list of moving average available it does not appear even though I have downloaded it in my indicators.
can you give me a hand?
thank you all.If you downloaded and installed it, then it should be under "indicators -> custom" and in that list.
If it's not there, then you probably didn't double-click to install the calgo file.
hello thanks for your answer. let me explain better ... I'm testing some trial and free cbots. I noticed that in the bot parameters window there are many types of moving averages, simple, exponential, weighted, triangular etc. however the jurik one is missing, despite having installed it in ctrader. can you make it appear in the list? thanks
No.
Only cTrader (Spotware) can do that. The only moving averages contained within that list are those that are natively included within cTrader.
If you want a Jurik moving average within a cBot, you have to make a separate parameter for it.
@firemyst
firemyst
26 Dec 2020, 12:55
RE:
vincenzo.dal.mare said:
Hello guys,
how can i enter the jurik moving average?
in the list of moving average available it does not appear even though I have downloaded it in my indicators.
can you give me a hand?
thank you all.
If you downloaded and installed it, then it should be under "indicators -> custom" and in that list.
If it's not there, then you probably didn't double-click to install the calgo file.
@firemyst
firemyst
26 Dec 2020, 12:53
How do you define in an "uptrend" and "downtrend"? A bot doesn't just think "in an uptrend"... you have to define conditions that define what you think an "uptrend" is that can be programmed.
And how do you define "when resistance is formed"? What's "resistance"? When price doesn't break a certain level after x-candles? On each bar? On each tick? What happens if it breaks that line, comes back to stop you out, and then immediately breaks the line again? Do you get back in? Or leave it for several bars? Something else?
You should be a bit more specific in your requirements.
@firemyst
firemyst
19 Dec 2020, 15:36
For the trailing stop, change the ExecuteMarketOrder lines to have the following:
ExecuteMarketOrder(TradeType.Sell, Symbol, VolumeInUnits, label, SL, TP, null, true, null);
and
ExecuteMarketOrder(TradeType.Buy, Symbol, VolumeInUnits, label, SL, TP, null, true, null);
@firemyst
firemyst
05 Dec 2020, 09:34
Not sure why you're asking because the pip-value doesn't change per-se on Forex pairs and indices.
For example, if you're trading the AUDUSD with Pepperstone, the pip value:
1) per 1 standard lot is always going to be 10 USD
2) per 0.1 standard lots is 1 USD
3) per 0.01 standard lots is 0.1 USD
Same thing with Indices.
Example again, point value per 1 standard lot on:
1) US500, US30, NAS100 is always 1 USD
2) AUS200 is always 1 AUD
3) GER30, FRA40 is always 1 EUR
4) UK100 is always 1 GBP
It doesn't matter if you're trading it today, tomorrow, yesterday, the current bar, or the previous bar.
The pip value doesn't change.
@firemyst
firemyst
01 Dec 2020, 03:49
RE: RE:
Adal said:
PanagiotisCharalampous said:
Hi Adal,
You need to remove the indicator from the chart, rename it in the Indicators list in cTrader Automate, build and then add it again.
Best Regards,
Panagiotis
How I write in the question I need to hide or present another indicator name. Is it possible?
From what @Panagiotis said, it does not seem possible. You have to have the same indicator name as it's called in the Automate section.
@Panagiotis , is it possible to have the listing of the parameters on the chart itself? See the OP's original post. It has "(secret1, secret1), NAN" across the indicator area. Can this be "hidden" somehow?
@firemyst
firemyst
29 Nov 2020, 10:05
To hide the name of the indicator, you'll have to call it something different. cTrader takes the name off of whatever name you give the indicator when you create the new one in the Automate section of cTrader.
To hide the parameters, you have to do something like the following:
//Change from this
[Parameter("Password1", DefaultValue = "secret1")]
public string Pass1 { get; set; }
[Parameter("Password2", DefaultValue = "secret1")]
public string Pass2 { get; set; }
//To this:
//[Parameter("Password1", DefaultValue = "secret1")]
public string Pass1 { get; set; }
Pass1 = "secret1";
//[Parameter("Password2", DefaultValue = "secret1")]
public string Pass2 { get; set; }
Pass2 = "secret1";
The parameters won't show up in cTrader, but with them set to "public", anyone who's importing your calgo file can see the properties "Pass1" and "Pass2" and access them.
If you want to hide them so they can't be seen outside the class file, change them from public to private.
@firemyst
firemyst
18 Jan 2021, 14:36
RE:
PanagiotisCharalampous said:
Hi @Panagiotis:
So Spotware includes a charting feature in cTrader that provides traders with zero control over the colors, zero control over any of its display features, and zero ability to even turn it on or off?
With all due respect and with that lack of basic functionality, such features shouldn't have to be "suggested".
Thank you :-)
@firemyst