Topics
Replies

firemyst
02 Jun 2023, 03:54 ( Updated at: 01 Dec 2024, 02:36 )

I would vote for the feature as it's already been posted as a suggestion:

 

 


@firemyst

firemyst
02 Jun 2023, 03:52

Examples you can look at to see irf they help?

 

And also watching this video:

 

 

 


@firemyst

firemyst
01 Jun 2023, 06:05

Why don't you actually write the author who posted the bot, or post a comment under the bot like others have done?

Or actually read the information posted on the bot's page on how to obtain that information?


@firemyst

firemyst
01 Jun 2023, 06:04

Apparently not yet. It is suggested though as a feature in the Suggestion forum to have the same functionality for Comments:

 


@firemyst

firemyst
01 Jun 2023, 06:00

This is more a C# thing than a cTrader thing.

If you unsubscribe from events, it could free up some resources and make available for garbage collection.

Do a little Google research.

https://stackoverflow.com/questions/506092/is-it-necessary-to-explicitly-remove-event-handlers-in-c-sharp#:~:text=Yes%2C%20you%20will%20want%20to,reference%20remains%2C%20it%20is%20live.

 


@firemyst

firemyst
01 Jun 2023, 05:56

First question: how do you know the code in your indicator is retrieving the correct market data for the faster time frame?

And do you have your indicator set up to handle multiple time frames? Eg, look at this example:

 

 


@firemyst

firemyst
01 Jun 2023, 05:53

WEll, there may be an issue in cTrader, there may be an issue with your code.

Nobody will be able to help identify the issue unless you post some code that reproduces the issue.


@firemyst

firemyst
01 Jun 2023, 05:52

You want to use "ExecuteMarketOrder", not "OpenMarketOrder"


@firemyst

firemyst
01 Jun 2023, 05:30

I know this post is old, but in case you weren't aware, this has been completed by Spotware so you can now have Heikin Ashi charts natively.


@firemyst

firemyst
01 Jun 2023, 05:22

//Sample code to help you get started:

//Set the line size. If timeframe is "Minute", make it 2. Otherwise, make it 1.
int lineSize = (Chart.TimeFrame == TimeFrame.Minute ? 2 : 1);

for (double level = start; level <= max + step; level += step)
{
    Print("{0} {1} {2}", level, level + half, level + quarter);

    Chart.DrawHorizontalLine("WholeLine" + level, level, cWhole, lineSize, LineStyle.Solid);
    Chart.DrawHorizontalLine("HalfLine" + level, level + half, cHalf, lineSize, LineStyle.Lines);
    Chart.DrawHorizontalLine("QuarterUpLine" + level, level + quarter, cQuarter, lineSize, LineStyle.Dots);
    Chart.DrawHorizontalLine("QuarterDownLine" + level, level - quarter, cQuarter, lineSize, LineStyle.Dots);
}

 


@firemyst

firemyst
01 Jun 2023, 05:16

I don't know that anyone has the actual source code to the native indicator within cTrader.

However, do a search on the site for "fibonacci" and you'll find other indicators/bots based on Fibonacci, and you might find code that can help you along:

https://ctrader.com/search

 

Or look for yourself in the library of indicators readily available:

 


@firemyst

firemyst
01 Jun 2023, 05:05

RE:

rafiki.matu said:

Hey guys, 

Trying to code an indicator that gives and arrow notification when the fast MA crosses the slow MA either from above or below. 
How do i add a filter to the code to include the 200 EMA and only give a notification when the cross occurs above the 200 EMA for buy signals and below the 200 EMA for sell signals. 
Anything i try gives errors.

Below is the piece of code where am stuck. 

The code does work whenever there is a MA cross but i want to add a filter to only give alerts after incorporating the 200EMA. 

if(Functions.HasCrossedAbove(fastMA.Result, slowMA.Result, 0)){
                Chart.DrawIcon("HasCrossedAbove",ChartIconType.UpTriangle,Bars[index].OpenTime,Bars[index].Low-arrowOffset,Color.LightBlue);
                
                if (Playsound && Cup<2 ){
                    Notifications.PlaySound(SoundPath);
                    Cup++;
                    Cdown=0;
                    }
                
                }

            if (Functions.HasCrossedBelow(fastMA.Result, slowMA.Result, 0)){
                
                Chart.DrawIcon("HasCrossedBelow",ChartIconType.DownTriangle,Bars[index].OpenTime,Bars[index].High+arrowOffset,Color.Red);
                
                if (Playsound && Cdown<2 ){
                    Notifications.PlaySound(SoundPath);
                    Cdown++;
                    Cup=0;
                   
                    }
                
                }
        }

        

    }
}

 

Any help will be highly appreciated. 

Thanks. 


 

 

Just test to see if the current closing price is above/below the 200MA.

//This is a mixture of sample/pseudo code but hopefully is enough to get you started
if (Bars.ClosePrices.LastValue > MA200.Result.LastValue)
{
	if (Functions.HasCrossedAbove(fastMA.Result, slowMA.Result, 0))
	{
		Chart.DrawIcon("HasCrossedAbove",ChartIconType.UpTriangle,Bars[index].OpenTime,Bars[index].Low-arrowOffset,Color.LightBlue);
                
                if (Playsound && Cup < 2 )
		{
                    Notifications.PlaySound(SoundPath);
                    Cup++;
                    Cdown=0;
		}
	}
}

else if (Bars.ClosePrices.LastValue < MA200.Result.LastValue)
{
	if (Functions.HasCrossedBelow(fastMA.Result, slowMA.Result, 0))
	{
		Chart.DrawIcon("HasCrossedBelow",ChartIconType.DownTriangle,Bars[index].OpenTime,Bars[index].High+arrowOffset,Color.Red);
                
                if (Playsound && Cdown < 2 )
		{
                    Notifications.PlaySound(SoundPath);
                    Cdown++;
                    Cup=0;
		}
	}
}

 


@firemyst

firemyst
01 Jun 2023, 04:55

Example to help you get started:

 

if (Bars[index].OpenTime.DayOfWeek != DayOfWeek.Sunday)

{

}

else

{

// skip Sunday

}

You just have to make sure your bot is set to work in your time zone, otherwise if your market data is being derived in another time zone, obviously that Sunday might not line up with your Sunday.


@firemyst

firemyst
01 Jun 2023, 04:48

You should post this in the "Suggestions" forum:

 


@firemyst

firemyst
30 May 2023, 11:56

You can use the TickVolume api and do your own calculations to determine pressure, or use any of the many indicators that do things with Tick volume.

An example:

 

And the cTrader indicator archive:

 


@firemyst

firemyst
30 May 2023, 11:51

Please post this to the Suggestions forum:

 


@firemyst

firemyst
29 May 2023, 15:52 ( Updated at: 21 Dec 2023, 09:23 )

RE:

PrincipalQuant said:

I'm looking for some fresh perspectives on this topic. Any ideas?

So your GPU isn't being utilized? Mine is:


@firemyst

firemyst
29 May 2023, 10:28

I would post this in the "Suggestions" forum:

 


@firemyst

firemyst
29 May 2023, 09:30

RE:

PanagiotisChar said:

@firemyst,

No need to tag us on every discussion :) If we haven't replied then probably we can't help. As far as I know this information is not available via the API

Aieden Technologies

Need help? Join us on Telegram

Need premium support? Trade with us

 

Well there you go @PanagiotisChar. Now that you've responded to this one you've just helped since nobody else seems to have known :-)

PS: I only tag you since you have all the insider info and knowledge about the product, or at least more than us regular joe-schmoes do :-)


@firemyst

firemyst
29 May 2023, 08:49

Great.

Yeah, the mobile version is a bit ridiculous with the little amount you can customize compared to other mobile trading platforms.

Get this, on the mobile version, even the only way to change the chart colors is changing the entire theme on your phone from "light" to "dark". They used to have it where you can specify the chart be in light or dark mode. Now, in order to do that, you have to put your entire phone in "dark theme", which is completely idiotic.

I really think Spotware needs to get a new person, who has actually looked at what competing products are capable of doing, and driving a better mobile version balancing features,  performance, and what traders actually want if they do put "traders first".


@firemyst