Hi,
i created 2 very simple system which goes long on the next opening, after a 2 up closes have occured. It exits on the close of the same bar, where the trade was opened.
The second "system" is that it opens a short trade under the same conditions.
Logically you would assume that if i lose on system 1 on a specific trade, let's say 100$, i would win on the other system (system 2) 100$, right?
Because it's the same trade only, in the other direction.
I programmed this, but i always get two different results. One said, that this is spread(commissions) i have to pay, but how do i programm it, so that i always get the "raw" data. So that the profit on the one system is equal to the loss of the second system. I hope you understand my problem and can clear me up. This would be very kind.
Thanks in advance.
Greetings
btw: below's my code (the bold text, is the only part which is different in system 2 - namely short instead of long):
PS: When do i actually have to take the bid, and when the ask price for sl/tp. Is it important for the strategytester, that i always pick the right price, because I think that it always take the bid price?
i created 2 very simple system which goes long on the next opening, after a 2 up closes have occured. It exits on the close of the same bar, where the trade was opened.
The second "system" is that it opens a short trade under the same conditions.
Logically you would assume that if i lose on system 1 on a specific trade, let's say 100$, i would win on the other system (system 2) 100$, right?
Because it's the same trade only, in the other direction.
I programmed this, but i always get two different results. One said, that this is spread(commissions) i have to pay, but how do i programm it, so that i always get the "raw" data. So that the profit on the one system is equal to the loss of the second system. I hope you understand my problem and can clear me up. This would be very kind.
Thanks in advance.
Greetings
btw: below's my code (the bold text, is the only part which is different in system 2 - namely short instead of long):
QuoteDislikedint start()
{
//----
//variables
double open;
static int ticket, err;
OrderClose(ticket,0.1,Bid,3,Red);
//--- OpenOrder Conditions Buy on 2-day upclose
if(Close[1]>Close[2]&& Close[2] > Close[3])
{
ticket=OrderSend(Symbol(),OP_BUY,0.1,Open[0],3,0,0,"buy on a 2day higher close",1,0,Green);
err=GetLastError();
if(ticket>0)
{
OrderSelect(ticket,SELECT_BY_TICKET);
MessageBox("Order opened at " + OrderOpenPrice(),"Order opened");
}
else
{
MessageBox("Error" + err, "ERROR!");
return(0);
}
}
//----
return(0);
}
PS: When do i actually have to take the bid, and when the ask price for sl/tp. Is it important for the strategytester, that i always pick the right price, because I think that it always take the bid price?
I'm getting there ... slowly