Topics
Replies

firemyst
14 Apr 2024, 10:18

RE: RE: Sl and Tp and Breakeven Bot HELP!

Jonathangong12 said: 

PanagiotisCharalampous said: 

Hi there,

“Order Execution Error Nothing to change” means that the property you are trying to modify has the same value as the previous one.

Best regards,

Panagiotis

How can I fix it?

Don't modify your position if nothing has changed. So you have to write code to see if the current value is the same as it was before you try to modify it. You have to ask yourself if the time and effort you'll spend on that is really worth it just to remove the cTrader popup that happens.


@firemyst

firemyst
14 Apr 2024, 10:14

Because that appears to be a custom indicator you are using… if you know how, you need to import them into your project or add them as a reference in Visual Studio.


@firemyst

firemyst
03 Apr 2024, 01:13

What if you uninstall and reinstall cTrader?

 

If you uninstall everything, and then do a fresh install of cTrader, and it's still identified as being a virus, I'd say it's probably a “false positive” on Bitdefender's part.

To prove this theory, on another computer where you have BItdefender installed and have never installed cTrader, install cTrader from Spotware itself (spotware.com) there and see what happens. If BItdefender flags it, that's definitely Bitdefender identifying false positives.


@firemyst

firemyst
03 Apr 2024, 01:10

You need to speak to TFT


@firemyst

firemyst
02 Apr 2024, 09:34

RE: RE: Backtest Entry Price: Market Orders vs. Pending Orders

ncel01 said: 

firemyst said: 

Can you post any code that replicates the issue?

Along with a screen capture of your back testing parameters.

I can if this is confirmed to be an issue. Otherwise it will be pointless.

Well, if you can't present the details on how to accurately reproduce, I wouldn't be surprised if they say they can't reproduce and/or confirm it. 

And round and round it goes 


@firemyst

firemyst
02 Apr 2024, 00:24

Can you post any code that replicates the issue?

Along with a screen capture of your back testing parameters.


@firemyst

firemyst
30 Mar 2024, 04:43

if (order.TradeType == TradeType.Buy)
{
}

@firemyst

firemyst
29 Mar 2024, 02:07 ( Updated at: 29 Mar 2024, 06:29 )

This needs to go in the SUGGESTIONS forum:

https://ctrader.com/forum/suggestions

 


@firemyst

firemyst
25 Mar 2024, 02:26 ( Updated at: 25 Mar 2024, 06:43 )

If you need help, this is the wrong forum to post to.

 

This forum is for suggestions only.


@firemyst

firemyst
25 Mar 2024, 02:25 ( Updated at: 25 Mar 2024, 06:43 )

Is what possible? Your sentence makes no sense


@firemyst

firemyst
25 Mar 2024, 02:21 ( Updated at: 25 Mar 2024, 06:43 )

You've posted in the wrong forum.

 

https://ctrader.com/forum/suggestions

 


@firemyst

firemyst
25 Mar 2024, 02:21 ( Updated at: 25 Mar 2024, 06:43 )

You're posting in the wrong forum:

https://ctrader.com/forum/suggestions

 


@firemyst

firemyst
25 Mar 2024, 02:18 ( Updated at: 25 Mar 2024, 06:43 )

You need to post it here:

https://ctrader.com/forum/suggestions

 


@firemyst

firemyst
25 Mar 2024, 02:16 ( Updated at: 25 Mar 2024, 06:43 )

THis is not the forum for this.

You need to post it here:

https://ctrader.com/forum/suggestions

 


@firemyst

firemyst
24 Mar 2024, 08:01

Hi there:

You can't change the colors of “Output”s programmatically. 

Instead, what you need to do is create another set of Outputs to represent the Lines that will be output when price rises above or below.

Assuming you want the line colors to change if price is above p[index] or below p[index] (as that's the only “pivot line” i see in your code).

So first, for the “tc” and “bc”, you need to make those plot types “DiscontinuousLine”

Next, create your new output objects. Ex:

[Output("TC2", LineColor = "Yellow", PlotType = PlotType.DiscontinuousLine, LineStyle = LineStyle.LinesDots, Thickness = 1)]
        public IndicatorDataSeries tc2 { get; set; }
        [Output("BC2", LineColor = "Cyan", PlotType = PlotType.DiscontinuousLine, LineStyle = LineStyle.LinesDots, Thickness = 1)]
        public IndicatorDataSeries bc2 { get; set; }

Then plot the values of each line accordingly:

p[index] = (High[index] + Low[index] + Close[index]) / 3.0;
//bc[index] = (High[index] + Low[index]) / 2.0;
//tc[index] = ((p[index] - bc[index]) + p[index]); 
    
if (Close[index] > p[index])
{
    bc[index] = (High[index] + Low[index]) / 2.0;
    bc2[index] = double.Nan;
    tc[index] = double.Nan;
    tc2[index] = ((p[index] - bc[index]) + p[index]);   
}
else if (Close[index] < p[index])
{
    bc2[index] = (High[index] + Low[index]) / 2.0;
    bc[index] = double.Nan;
    tc2[index] = double.Nan;
    tc[index] = ((p[index] - bc[index]) + p[index]);   
} 
else 
{
    bc[index] = (High[index] + Low[index]) / 2.0;
    bc2[index] = double.Nan;
    tc2[index] = double.Nan;
    tc[index] = ((p[index] - bc[index]) + p[index]);   
}

@firemyst

firemyst
23 Mar 2024, 03:24 ( Updated at: 23 Mar 2024, 05:34 )

You need to be more clear in your post.

You say “how can i exclude catches in the second loop if the symbol is already present in the first one?” when you have 4 loops in your example code.

Then you say, “not show lomit orders if a active position is already open on the same symbol.” when your sample code for limit orders is the 3rd loop shown in the code?

If I understand what I think you're trying to do, why not just:

if (Positions.Count(x => x.SymbolName == theSymbolName) == 0)
{
    //didn't find it in current open positions, so add it
    if (!Limits.ContainsKey(theSymbolName)
        Limits.Add(theSymbolName,0);
}

@firemyst

firemyst
22 Mar 2024, 08:01

RE: RE: "Memory management" in cbots

ctid4921325 said: 

firemyst said: 

Most of the newbies I've helped, their memory issues stem from having a lot of Print statements in their code. Printing lots of information to the logs will suck up memory since there's no automated way to clear it.

The other big problem is if your indicators/bots draw A LOT of chart objects. cTrader cannot easily handle hundreds and hundreds of custom chart objects being drawn on charts. For instance, if you draw your own custom TrendLine objects, once you hit about 1,000 objects, performance will degrade noticeably. So you have to have your own built in methods to clean up objects, or limit the number you draw on any chart continuously. Example: if you use TrendLines to draw your own Heikin Ashi candles on a chart overlaying normal candles on say an M1 chart, you'll easily end up with over 500 HA bars on top of the regular M! bars. So what you need to do is limit it so your indicator/bot only draws the most recent 500 HA bars, removing the previous ones on each new bar drawn. 

And for such drawings, you only want it to happen “OnBar” and not “OnTick” where possible – redrawing everything on every tick is very resource intensive, especially if you have multiple indicators/bots doing it at the same time.

Ahah.. fantastic thanks firemyst.. yes, I am outputing hundreds of lines of print.  I have the print wrapped in a method called Debug, which skips or pints based parameters, but it is on. I will turn those off and see what happens.

I do a little bit of drawing, but i'm not approaching 100 objects let alone 1000, and I've moved almost everything to OnBar out of ontick.

Thanks for the tip, I'll turnon/reduce my prints and we'll see what that does.

 

Thanks again.

Keep us posted please.

In my bots/indicators, I have a “debug” flag as a parameter that I can set when I run them. Of course, if true it will print out lots of info to the log; when false it doesn't print anything from the code. I've found this to be a great approach.


@firemyst

firemyst
22 Mar 2024, 01:15 ( Updated at: 22 Mar 2024, 07:52 )

Most of the newbies I've helped, their memory issues stem from having a lot of Print statements in their code. Printing lots of information to the logs will suck up memory since there's no automated way to clear it.

The other big problem is if your indicators/bots draw A LOT of chart objects. cTrader cannot easily handle hundreds and hundreds of custom chart objects being drawn on charts. For instance, if you draw your own custom TrendLine objects, once you hit about 1,000 objects, performance will degrade noticeably. So you have to have your own built in methods to clean up objects, or limit the number you draw on any chart continuously. Example: if you use TrendLines to draw your own Heikin Ashi candles on a chart overlaying normal candles on say an M1 chart, you'll easily end up with over 500 HA bars on top of the regular M! bars. So what you need to do is limit it so your indicator/bot only draws the most recent 500 HA bars, removing the previous ones on each new bar drawn. 

And for such drawings, you only want it to happen “OnBar” and not “OnTick” where possible – redrawing everything on every tick is very resource intensive, especially if you have multiple indicators/bots doing it at the same time.


@firemyst