TYG's Workshop: Robotic System

Trading Labs: Moving Average Crossover

MA Crossover is one of the oldest strategy that is still being used by most traders. :slight_smile:

2 Likes

hi @TYGMedia,

i am trying to set my code up here not sure what the issue is. attempting to make price alert at certain price. however, it keep triggering for no reason when its not at price point :thinking:

Maybe I’m missing something that i haven’t learnt yet perhaps a limiter and we can combine with Boolean to stop triggering on every tick? :thinking:

Hi @tomo22 ,

Before you do the code, you need to define what you want. :slight_smile:

For example you want to show alert when bid price is above 1.04460, your code is correct.

The problem is OnTick will be triggerd for every price movement.

So you will have price alerts every time the price moves when the condition is true.

You have to know if statement will only execute 1 statement bellow. If you want it more than one, you have to put the code in between { and }.

Your code is not ideal, since you will be flooded by alerts. So you have to limit the alert by time. For example you want it appears every 1 minute, you need to record when the last time the code show alert. Then you will show again after the delay has been surpassed.

You can also show limit for every new candle stick, by using iBars or iTime. So every time you show alert, you record the iBars or iTime. You only show alert when the recorded data is different from iBars or iTime. :slight_smile:

1 Like

perhaps a different event handling function?

is there a way to make it more simpler perhaps. i just started so i dont think i can code delays :laughing:

Hi @tomo22,

This is the most very very super simplest idea :sweat_smile:

Here is the code:

1 Like

hi @TYGMedia, thank you for this help. i will digest and understand the pieces about this code when I’m finished learning basics.

currently learning about IF statements :smiley:

1 Like

Trading Labs: Stochastic Crossing - EURUSD


Here is trading stats of Stochastic on EURUSD.
Becoming a trader should be a part of our adventure to grow our wealth.

2 Likes

hi @TYGMedia,

i am still encountering similar issue where alert repeatedly goes off regardless if price is reached.

Confused about this because we have IF statement commanding that priceBid has to be equal to or greater than our iPrice for alert and price to be triggered. :thinking:


input double iprice = 1.04400; // price alert

datetime LastMinute =0 ;

void OnTick()
{

double PriceBid = SymbolInfoDouble(_Symbol, SYMBOL_BID);

if ( ( PriceBid>=iprice) && ((TimeCurrent()-LastMinute) >60))
{

LastMinute = TimeCurrent();
Alert(StringFormat(“Price has reached %f on %s”, iprice, _Symbol));

}

}

Hi @tomo22,

Before you write the code, you need to define what you actually want :slight_smile:

The code will show alert every 60 seconds, until the condition is no longer fit. So you will have the alert as long as the condition is fit.

For example, if you want the alert show only once, the code will be different. Everything has to be define properly. From your requirements, we can design the algorithm and finally write the code.

These are the rules for every code you want to write :slight_smile:

2 Likes

hi @TYGMedia, thank you for the insight. I understand now that adjust >60 will essentially change the reoccurrence. In terms of alert only showing once that i will have to figure out.

what does this mean? because alert is going off at price point despite it not being at the price point :thinking:.

perhaps maybe removing the > sign from

is the answer since the alert will keep on triggering if price is higher than Iprice. Whereas i only want it to trigger at iprice. so maybe

if ((PriceBid = iPrice may solve it)

Hi @tomo22,

If, that’s the case, you don’t need code.

You can create alert from MT5.

You only need code, for specific thing, with retention.

If you use =, when the price jump, the alert will probably will be skipped.
Market price movement isn’t ideal. Most of the time it jumps quite fast. :slight_smile:

Trading Labs: MACD Crossing - EURUSD


How to use MACD? Here is one of them

Trading Labs: Best Platform for Trading Bot

I’m thinking on my desk to figure out new trading concept. I have done many bot, bored, looking for new thing to work with. Many platform have been used, my favorite are only two, MT5 and cTrader. I haven’t found others could compete with them. I love the cTrader’s features that allow us to utilize different information widely, but however we can’t collaborate information from “different market”. One terminal can only use 1 cTrader. Comparing MT5, we can install multiple instance of MT5 on single terminal. When we combine cTrader data complexity with MT5’s flexibility, it will give us a new trading perspective. We can utilize market weaknesses for additional pocket money.

A lot of other trading perspective in mind can’t be realize due to technology barrier. Probably it will be available for few years ahead. :roll_eyes:

1 Like

Multiple instances is built into cTrader. No need with the faffing about

You want the bottom option ticked presumably

Hi @chesterjohn,

Thanks for the information. yes, the cloud feature is really helpful. The problem is we can’t connect two different markets with cTrader. Example I use cTrader on 2 or more different brokers. I need to compare the price between them. MT5 allows us run multiple instance on a terminal (VPS). I can use file, namepipe protocol or memory drive to share information to all bots under same terminal.

On cTrader when you run the bot, it will exclusive. I can’t share the data ot other cBot. Let say i can share it by using file sharing, that will be to slow for other bot to get data from a sharing folder. Perhaps bot collaboration isn’t a thing for cBot :slight_smile:

1 Like

The cloud feature is great, but those settings are to run multiple instances of cTrader. If you choose the different settings files, it seems you can log in to different brokers although I don’t have multiple accounts to test it.

I’d have thought you could use FIX API to do what you’re wanting to do, but again I have no experience of this.

1 Like

hi @chesterjohn,

I need exactly this feature. :slight_smile: The problem is, it seems only one account can be activated. I have no enough experience with cBot to make it run :smiley:
Yes, I had asked question with Telegram support, but still has no solution until now.

About Fix API, i try to use python to develop it, since I use Linux as the server. But experiencing a lot of troubles, missing library and it seems the python project is still in development phase.
Example: it can run, but with a lot of warning

I wish they will work on Linux Version instead of windows version as well. Their technology has been quite old, since Microsoft focus on .net Core. cTrader is still using .net 6. :roll_eyes:

1 Like