**Algo-FX:**When i do the math for the buystop order, I get a stop loss of 319pips (1.09971-1.09652) and take profit of 281 pips (1.10252 - 1.09971),

- 1.09971-1.09652=0.00319 which is 31.9 pips
- 1.10252-1.09971=0.00281 which is 28.1 pips
- There is
*Tick*,*PIP*, and*Point*. They are all different in general. A tick is the smallest change of price. A Point is the least significant digit quoted. In currencies a pip is defined as 0.0001 (or for JPY 0.01)On a 4 digit broker a point (0.0001) = pip (0.0001). [JPY 0.01 == 0.01] On a 5 digit broker a point (0.00001) = 1/10 pip (0.00010/10). Just because you quote an extra digit doesn't change the value of a pip. (0.0001 == 0.00010) EA's must adjust pips to points (for mq4.) In currencies a tick is a point. Price can change by least significant digit (1.23456 -> 1.23457)

In metals a Tick is still the smallest change but is larger than a point. If price can change from 123.25 to 123.50, you have a

*TickSize*of 0.25 and a point of 0.01. Pip has no meaning.This is why you don't use

*TickValue*by itself. Only as a ratio with*TickSize*. See DeltaValuePerLot()

I am writing an EA to place buystop and sellstop orders, everything works great but I do not think I am calculating the sl and tp values correctly in my code.

in the code:BST = 10

SL = 30

TP = 30

xecn = 10

the broker uses a 5 digit quote and spread is 19

here is the code for buystop:for sellstop:An example order from testing is as follows:

2015.10.26 15:20:09.493 2015.07.23 09:00 TriangleTS v3.1 EURUSD,M30: open #25 buy stop 0.10 EURUSD at 1.09971 sl: 1.09652 tp: 1.10252 ok

2015.10.26 15:20:09.493 2015.07.23 09:00 TriangleTS v3.1 EURUSD,M30: open #26 sell stop 0.10 EURUSD at 1.09752 sl: 1.10071 tp: 1.09471 ok

When i do the math for the buystop order, I get a stop loss of 319 pips (1.09971-1.09652) and take profit of 281 pips (1.10252 - 1.09971), when I am expecting them both to be 300.

Should I be using Ask to calculate my stop loss and take profit??

please help this very confused new guy