Help with creating a robot / script (simple trailing stop adjust)

 

Hello Everyone.

I'm new to MQL5 but there's something I wanted to create as a very basic rule, to then test as an automatic trade robot in a particular currency or stock.

the code is quite simple and in a way i can make it in excel and sql:


(assuming I'm only considering this to be executed at every close price of each candle) - ideally I would be able to specify if this is set to 1minute , hour, week or a month candle

IF "No buy order exists"

AND previous_price < actual_price

Then BUY and

Set stop loss to buy price - 1%

Set Trailing stop to buy price - 1%

Else skip to next candle



IF "Buy order exists"

AND (actual price -1%) > trailing stop

THEN Set Trailing stop = Actual price - 1%

ELSE skip to next candle


Not even sure if this is already available by default within the tool, even though I couldn't find it.


Thank you

 

Anyone?

Thank you

 
https://www.mql5.com/en/job
Trading applications for MetaTrader 5 to order
Trading applications for MetaTrader 5 to order
  • www.mql5.com
i have an indicator which gives signals based on two lines crossover, however it sometimes gives signals when there is no crossover at all which renders it unreliable. When i forward test, sometimes a signal appears and i can clearly see that there is no crossover. If i switch to another time frame and come back to the original one, all the...
 

Hello, I understand I can post a job for this,

But can I have an understanding of how difficult this is?

would this job cost 5$? 50$?


Is there a similar robot already available that I could test in a demo account?


Thank you

 
alvesricardo:

Hello, I understand I can post a job for this,

But can I have an understanding of how difficult this is?

would this job cost 5$? 50$?


Is there a similar robot already available that I could test in a demo account?


Thank you

The minimum is $30.

 
Eleni Anna Branou:

The minimum is $30.

Right!

I'll Rephrase.

I have no idea of the effort for this.

Would this cost 30$? would it cost 100$?


Thank you

 
alvesricardo:

Right!

I'll Rephrase.

I have no idea of the effort for this.

Would this cost 30$? would it cost 100$?


Thank you

It will cost whatever somebody is willing to do it for. You can put price at $30+ and the developers will bid for it.

Some may say 30, some more.

 
alvesricardo:

Right!

I'll Rephrase.

I have no idea of the effort for this.

Would this cost 30$? would it cost 100$?


Thank you

to be informed, from my point, it is not very complicated except trailing part which need some more details

Also your EA scope is not fully clear to a developer to give you exact price.

i.e. Don't you need to have any sell inside your system?

 
ArashB:

to be informed, from my point, it is not very complicated except trailing part which need some more details

Also your EA scope is not fully clear to a developer to give you exact price.

i.e. Don't you need to have any sell inside your system?

thanks for replying.


"i.e. Don't you need to have any sell inside your system?"

well... not really, This is something really simple that I wanted to try and see how it works... but I can't program.

I don't think I would need a "sell" or a "take profit".

In theory nothing will go up endlessly.. so the stop loss and the trailing stop should do the trick.

my idea is that I would always loose at most 1% (stop loss) if it goes down.

If it goes up, then trailing stop is always highest value - 1%. So, whenever the trailing stop is triggered a Sell would happen.

FYI, I don't know how much are comisions, if i need to pay to have an open order per day, or for many days...

 
alvesricardo:

Hello Everyone.

I'm new to MQL5 but there's something I wanted to create as a very basic rule, to then test as an automatic trade robot in a particular currency or stock.

the code is quite simple and in a way i can make it in excel and sql:


(assuming I'm only considering this to be executed at every close price of each candle) - ideally I would be able to specify if this is set to 1minute , hour, week or a month candle

IF "No buy order exists"

AND previous_price < actual_price

Then BUY and

Set stop loss to buy price - 1%

Set Trailing stop to buy price - 1%

Else skip to next candle



IF "Buy order exists"

AND (actual price -1%) > trailing stop

THEN Set Trailing stop = Actual price - 1%

ELSE skip to next candle


Not even sure if this is already available by default within the tool, even though I couldn't find it.


Thank you


The worst part of building an Expert Advisor is the Trade management per se, not the methodology/strategy of entering and exiting a trade...

How to Order an Expert Advisor and Obtain the Desired Result
How to Order an Expert Advisor and Obtain the Desired Result
  • www.mql5.com
Automated trading is gaining a new momentum - the release of MetaTrader 5, with the new MQL5, is complete. It has successfully passed the Automated Trading Championship 2010, and the new version of the trading platform is being actively promoted by brokers. The predecessor of the MetaTrader 5, - MetaTrader 4 - is still actively used by hundreds...