Hello fellow traders,
I have here a drawing that I've made for myself to more easily understand how I am to create manual coded Take Profits and Stop Losses.
The green X's represent an open order and is called a Point from now on.
I have no problem with the actual coding. I find it really easy.But I would love to know if I am thinking about this right.
So, in the first scenario we open a Buy position at Point one with only Take Profit set at 10 Pips. When there is 10 Pips of difference between the current Bid Price and the Price we opened the trade at this should tick.
if (Bid >= (OrderOpenPrice + TakeProfit)
//Close with Profit (Of course at Bid)
In the second one we open another Buy position at Point two with only Stop Loss set at 10 Pips. When the difference between the current Ask price and the price we opened the trade at is over 10 Pips this one should tick.
if (Ask <= (OrderOpenPrice - StopLoss)
//Close with Loss (Of course at Bid)
Is this okay?Thanks a lot,Lovro Mirnik
On the chart you see only bid prices (op, hi, lo, cl,..).
You enter a buy at ask and exit a buy at bid and you enter a sell at bid and exit a bid at ask.
It is pretty simple you'll always get the worse price of both.
To add comments, please log in or register