5th Decimal Place Question

 

I'm sure this is probably simple, but how to I adjust my SL and TP from 4th decimal place to 5th?

TakeProfitB = (Bid+10*Point);
TakeProfitS = (Ask-10*Point);

 

Well, just add one zero..


TakeProfitB = (Bid+100*Point);
TakeProfitS = (Ask-100*Point);

Or if you dont want to confuse yourself, you can use Point*10 which will do the same thing. or you can make new variable for Point and then = Point*10

Basically the only thing you need to do is to multiply everything by 10.. There are so many ways to do. I just simply add one zero in my EA..

 
jirimac wrote >>

Well, just add one zero..

TakeProfitB = (Bid+100*Point);
TakeProfitS = (Ask-100*Point);

Thanks! That worked. Keep getting invalid stops.

Do you have any ideas as to how to close one trade and open another without getting " error 149 "? ( Hedging Prohibited ) I'm not trying to hedge. Only want one trade open. Just want to be able to open buy, then close it and open sell without error.

Thanks again!

 

Well, you need to make sure that the trade is closed before opening new one..

What I do in my EA, i always count the open positions and only open new trade when there is 0 open orders.. But im sure there are many different ways.. Just search in this forum, i saw this problem before so you might get your answer there..

 
jirimac wrote >>

Well, you need to make sure that the trade is closed before opening new one..

What I do in my EA, i always count the open positions and only open new trade when there is 0 open orders.. But im sure there are many different ways.. Just search in this forum, i saw this problem before so you might get your answer there..

Thanks! I seemed to me that my problem was a timing issue. I put several print statements into my EA to narrow down the problem and found that the first order wasn't closing. Then the second came up with error 149.

 

Don't forget to adjust your slippage for 5 decimal places too.


CB

Reason: