Page 1 of 1

Entry Price Question

Posted: Mar 30 2017
by mcjohn
I can't seem to get the Entry Price retrieved for the open position. What I am I doing wrong here?

inputs:
Reverse1(10);//distance in pips

vars:
intrabarpersist openPosPL(0),
entryRate(0);

//Formulas
openPosPL = GetPositionOpenPL(GetSymbolName,GetAccountID);
entryRate = entryprice_checked(0);

//Print Output
If LastBarOnChart and BarStatus(1)=2 then begin
once ClearPrintLog;
print("");
Print("Date:", Date: 9:0, " ", "Time:", Time:5:0);
Print("Open Position Profit PL:", openPosPL);
Print("Initial Entry Price:", entryRate:4:4);
end;

-----------------
Here is what I get in the output.,
Date: 1170330 Time: 1526
Open Position Profit PL: -0.90
Initial Entry Price:0.0000

Re: Entry Price Question

Posted: Mar 30 2017
by TJ
See post #1 & #2
viewtopic.php?t=11713

Re: Entry Price Question

Posted: Mar 30 2017
by mcjohn

Code: Select all

inputs:
Reverse1(10);//distance in pips

vars:
intrabarpersist openPosPL(0),
entryRate(0);


//Formulas

openPosPL = GetPositionOpenPL(GetSymbolName,GetAccountID);
entryRate = entryprice_checked(0);


//Print Output

If LastBarOnChart and BarStatus(1)=2 then begin
once ClearPrintLog;
print("");
Print("Date:", Date: 9:0, " ", "Time:", Time:5:0);
Print("Open Position Profit PL:", openPosPL);
Print("Initial Entry Price:", entryRate:4:4);
end;

Re: Entry Price Question

Posted: Mar 30 2017
by mcjohn
See Code in Code Box Above.
Problem: EntryRate does not work as described in the documentation. Why does the code above in the Code Box not retrieve and print the Entry Price? I tried both EntryPrice and EntryPrice_Checked which both had similar descriptions.

There is only one position and it retrieves the GetPositionOpenPL correctly so there is definitely a position recognized. The parameter for entryprice_checked is set to 0 to retrieve the open position, which is what I want.

The position is created manually as you can see that there is no other code in the Code Box above that would create a trade. Is it not possible to obtain the entry price of a manually entered trade?

Here is what I get in the output.,
Date: 1170330 Time: 1526
Open Position Profit PL: -0.90
Initial Entry Price:0.0000

Re: Entry Price Question  [SOLVED]

Posted: Mar 31 2017
by ABC
mcjohn,

EntryPrice doesn't return values from the Order & Position Tracker, it just returns the entry price of a signal on that chart.

Regards,

ABC

Re: Entry Price Question

Posted: Mar 31 2017
by mcjohn
Is there a solution to return the entry value of a manual trade?