Forum

Constant Price Level

How can I make a certain price level like the Low[1] to be a constant? My aim is to set a level of the previous bar as a stoploss that will work if the close price of any of the next bars is lower it, but not the bid (current) price like usually

Money Management Code

I want to ask you to help a noob to get a ready programmed code for money management feature. I want the difference between the possible Open price and the StopLoss to be not more than 5% of my whole balance. In the case when it's more than 5% the order must not be opened. I'm sure some of you have

Indexed Bars

Can I assign the Open and Close price of the previous bar like this: Open1=Open[ 1 ]; Close1=Close[ 1 ]; Or should I do it this way: i = Bars - counted_bars - 1 ; And then use in the form of: Open[i+ 1 ]; Close[i+ 1 ]; Is it the same or not

Zero Divide

Hi, I have a proble when during a Strategy Testing i always get an error "zero divide". The only division I have are these lines - Proportion1=(Close0-Open0)/(Close0-Open1); Proportion2=(Close2-Open2)/(Open1-Close1); Proportion3=(Close0-Open0)/(Close2-Open2);