Help with PRICE_OPEN and PRICE_CLOSE

 

Hi. I'm new to the forum. Love it, by the way. I want to thank many of you for your contributions as they have helped me by leaps and bounds. I used to program C++ and so am familiar with many of programming syntax. What I am having trouble with is the PRICE_OPEN and PRICE_CLOSE . What exactly are these? I'm trying to make an expert advisor and I got a pretty good one going.

My expert advisor relies a little on RSI indicator and when it's over 50 and increasing, it's supposed to buy . I've got it written like:

iRSI(Symbol(),5,14,PRICE_MEDIAN,0)>iRSI(Symbol(),5,14,PRICE_MEDIAN,1)&& iRSI(Symbol(),5,14,PRICE_MEDIAN,0)>50

I used price median because I didn't know what to use. Does everything look right? Symbol() would be EURUSD and such, right? And 5 is the time frame (5 minutes). Well, I used this notation and it made a buy when the RSI was about 30. ? I don't know why it did that. It made this buy when I was backtesting, though so maybe it wouldn't have done it live?

Do you think a mechanical system is even possible? I'm hearing some experienced traders say "no".

 

PRICE_OPEN and PRICE_CLOSE are the opening and closing prices of the bar of the time frame being used.

In your example, iRSI(Symbol(),5 ,14,PRICE_MEDIAN,1), the "5" means you are using a 5 minute bar and the "1" means you are using the previous bar. If that is "0", that means it is the current bar. One problem is that, you can't have the closing value of the current bar till the bar is closed. Thus, any calcs using "0" is not right, unless you have very specific reasons for doing so.

Hope this helps,

Maji

 

Ok, thanks Maji. That makes sense. Seems like everytime I get one problem solved another rears its ugly head. Anyone have success with a mechanical system over a few months? Live? I feel better about using a mechanical system because I want to take the emotional side out of trading for myself.

How would I set a stoploss at the opening buying price after the Ask price has gone over by 5 pips? Hope I wrote that correctly. I'm trying to learn Forex and Metatrader at the same time.

Here is how I did the IF statement. Is this correct?

if (OrderStopLoss()=OrderOpenPrice()+5){

////modify stop loss code

}

For some reason, it didn't work.

EDIT: I think I see what I did. I used 5 instead of 5*Point . Forgot, dealing with pips.

Reason: