opening an order on a comming candle

To add comments, please log in or register
KLAF
16
KLAF  

hello,

I need help to write a code wich will  allow me to open an oder

at the opening of the next comming candle.


From example.

// here are Stochastic value

iStochasticValue= iStochastic current value ( current candle Stochastic value)

iStochasticPreviousValue= iStochastic previous value ( previous candle Stochastic value)


// here are Stochastic avarage value or  Stochastic  signal value

StocSignalCurrentValue= Stochastic signal current value

StocSignalPreviousValue= Stochastic signal pevoius value

// buy order opening condition

if (( StocSignalPreviousValue >iStochasticPreviousValue) &&(StocSignalCurrentValue < iStochasticValue))

buy at the openning of the comming candle. Which means at the openning of (-1) candle.


Nice to help me to write the condition which will allow me to open an order like that.

Mohammad Hashemi
3017
Mohammad Hashemi  

its so simple just declare a double mylow variable  like this:

if ((myLow!=Low[1] &&StocSignalPreviousValue >iStochasticPreviousValue) &&(StocSignalCurrentValue < iStochasticValue)){

myLow=Low[1] ;

William Roeder
19843
William Roeder  
KLAF: I need help to write a code wich will  allow me to open an oder at the opening of the next comming candle.
  1. Help you with what? You haven't stated a problem, you stated a want. Show us your attempt (using the CODE button) and state the nature of your problem.
              No free help
              urgent help.

    Or pay someone. Top of every page is the link Freelance.
              Hiring to write script - General - MQL5 programming forum

  2. Where is your test for new Bar?
    For a new bar test, Bars is unreliable (a refresh/reconnect can change number of bars on chart,) volume is unreliable (miss ticks,) Price is unreliable (duplicate prices and The == operand. - MQL4 programming forum.) Always use time.
    I disagree with making a new bar function, because it can only be called once per tick. A variable can be tested multiple times.
              New candle - MQL4 programming forum
KLAF
16
KLAF  
Mohammad Hashemi:

its so simple just declare a double mylow variable  like this:

if ((myLow!=Low[1] &&StocSignalPreviousValue >iStochasticPreviousValue) &&(StocSignalCurrentValue < iStochasticValue)){

myLow=Low[1] ;

Mohammad Hashemi,

sorry I dont understand how to do it.

Please could be more explicit. I am still a beginner.

Think you for your help

KLAF
16
KLAF  
William Roeder:
  1. Help you with what? You haven't stated a problem, you stated a want. Show us your attempt (using the CODE button) and state the nature of your problem.
              No free help
              urgent help.

    Or pay someone. Top of every page is the link Freelance.
              Hiring to write script - General - MQL5 programming forum

  2. Where is your test for new Bar?

William Roeder

you said where is my test for new bar...

I sent my message to get help, how to write this code test in mql4  for the new bar

and take only one position, buy or sell at the opening of the new bar.

I read the links about the bars that you sent me but I still can't correctly write the code

to take my position at the opening of the new candle.

Please help to write it.

William Roeder
19843
William Roeder  

What part of "Show us your attempt" was unclear?

MT4: Learn to code it.
MT5: Learn to code. If you don't learn MQL4/5, there is no common language for us to communicate. If we tell you what you need, you can't code it. If we give you the code, you don't know how to integrate it into yours.

or pay (Freelance) someone to code it.
          Hiring to write script - General - MQL5 programming forum

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 CODE button) and state the nature of your problem.
          No free help
          urgent help.
KLAF
16
KLAF  

William Roeder

I didn't tell you that, I do not know about MQL4 programming.

I'm just saying that someone could advise me how to write

the code condition that will allow me to open a position at the opening of the

new candle.(Candle (-1) in MQL4 programming ).

And I will introduce this condition in my expert.

Once this condition and the other conditions that I have given myself are verified,

my expert automatically opens a buy or sell order at the openning of next candle.

I think this forum aims to help each other and allow everyone to progress.

William Roeder
19843
William Roeder  
KLAF: I'm just saying that someone could advise me how to write the code condition that will allow me to open a position at the opening of the new candle.(Candle (-1) in MQL4 programming ). And I will introduce this condition in my expert.

I already gave you a link to that. #2.2 If you know how to code, do it. What's stopping you?

To add comments, please log in or register