Download MetaTrader 5

Can MQL4 do that?

To add comments, please log in or register
mpantogi
317
mpantogi  

Hello there,

After 2 years learning about forex,test some strategies and create new, i deside to automated my strategy.I have knowledge in java and now i  buy a book and start learning mql4.

Before start coding i want someone to help me answer these questions:

1.Let's say that i use 1 hour chart.Can i use indicators prices from 4 hour chart?

2.Can i keep data from the past?Examble: moving average cross each other and i want to open a trade if RSI>0,but that time the RSI is 55 and the trade don't opened.Is a way

to keep the data for RSI  for 2 hours?Can i use some list for that,which every time first in and last be out?So let's say i have the cross moving average and the RSI is 55,but before an hour was 50,then trade should open.


Thank you

whroeder1
16555
whroeder1  
mpantogi:

Hello there,

1.Let's say that i use 1 hour chart. Can i use indicators prices from 4 hour chart?

2.Can i keep data from the past?

Examble: moving average cross each other and i want to open a trade if RSI>0,but that time the RSI is 55 and the trade don't opened.

Is a way to keep the data for RSI for 2 hours? Can i use some list for that, which every time first in and last be out?

So let's say i have the cross moving average and the RSI is 55, but before an hour was 50, then trade should open.

Welcome to MT4.
  1. Look at any Technical Indicators What is the second argument? Just don't mix apples and oranges.
  2. Between OnTick calls, use static or Global Variables. See #5
  3. Do you know what the range of RSI is? It is [zero to 100]. It's always positive. If your code didn't open an order, your code is broken. Use the debugger or print your variables and find out why. Check your return codes and find out why. What are Function return values ? How do I use them ? - MQL4 forum and Common Errors in MQL4 Programs and How to Avoid Them - MQL4 Articles
  4. Look at any Technical Indicators  What is the last argument? No need to keep it.
  5. So code it to do that.
You have only four choices: We're not going to code it for you (although it could happen if you are lucky or the problem is interesting.) We are willing to help you when you post your attempt (using SRC) and the nature of your problem. No free help. urgent help.
Yohana Parmi
3495
Yohana Parmi  
mpantogi:

Hello there,

After 2 years learning about forex,test some strategies and create new, i deside to automated my strategy.I have knowledge in java and now i  buy a book and start learning mql4.

Before start coding i want someone to help me answer these questions:

1.Let's say that i use 1 hour chart.Can i use indicators prices from 4 hour chart?

2.Can i keep data from the past?Examble: moving average cross each other and i want to open a trade if RSI>0,but that time the RSI is 55 and the trade don't opened.Is a way

to keep the data for RSI  for 2 hours?Can i use some list for that,which every time first in and last be out?So let's say i have the cross moving average and the RSI is 55,but before an hour was 50,then trade should open.


Thank you


Yes, both can be done in MQL4.

mpantogi
317
mpantogi  

Thank you,


I was thinking that all of this can done with code,i was need only to be clear to me before i start.

For the RSI it was a syntax error,i wanted it to write R>50.

Much work start now,hope in the end that wii make me happy

To add comments, please log in or register