Entry Price Question  [SOLVED]

Questions about MultiCharts and user contributed studies.
mcjohn

Entry Price Question

Postby mcjohn » 30 Mar 2017

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

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: Entry Price Question

Postby TJ » 30 Mar 2017

See post #1 & #2
viewtopic.php?t=11713

mcjohn

Re: Entry Price Question  [SOLVED]

Postby mcjohn » 30 Mar 2017

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;

mcjohn

Re: Entry Price Question

Postby mcjohn » 30 Mar 2017

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

User avatar
ABC
Posts: 718
Joined: 16 Dec 2006
Location: www.abctradinggroup.com
Has thanked: 125 times
Been thanked: 408 times
Contact:

Re: Entry Price Question

Postby ABC » 31 Mar 2017

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

mcjohn

Re: Entry Price Question

Postby mcjohn » 31 Mar 2017

Is there a solution to return the entry value of a manual trade?


Return to “MultiCharts”