Hi everybody!
I would need some help because I can get fix a trouble I have with "entryprice".
My problem is very simple: I have a signal who opens a position in the morning and close it at the end of the day with setexitonclose and I just would like to plot the value of the open trade (the entryprice) on the graph but if I call "entryprice" or "entryprice(0)" it returns 0.
Instead I have tried to call "entryprice(1)" and in fact it returns the value of the opening trade of the day before!
So I am getting crazy because I do not understand why I can't have the entryprice of the trade of the current day!
Is there anybody who can help me please?
Thanks and ciao (from Italy)
Problem with entryprice [SOLVED]
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
Re: Problem with entryprice
Thank you very much TJ in particular for the suggestion about setexitonclose.
I still have the problem with "entryprice" when if it is calculated at EOB: I attached the rows of the codes and the results that I get from using entry price(1) and entryprice(0) in my graph (Dax, 15 minutes timeframe).
I would expect that at the 4th bar of today it should display the entry price of the current open trade, instead using "entryprice" it returns 0 while using entryprice(1) it returns the value of the previous entry... what am I doing wrong?
Many thanks!
I still have the problem with "entryprice" when if it is calculated at EOB: I attached the rows of the codes and the results that I get from using entry price(1) and entryprice(0) in my graph (Dax, 15 minutes timeframe).
I would expect that at the 4th bar of today it should display the entry price of the current open trade, instead using "entryprice" it returns 0 while using entryprice(1) it returns the value of the previous entry... what am I doing wrong?
Many thanks!
- Attachments
-
- entryprice.gif
- (72.54 KiB) Downloaded 694 times
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
Re: Problem with entryprice
What is EP?Thank you very much TJ in particular for the suggestion about setexitonclose.
I still have the problem with "entryprice" when if it is calculated at EOB: I attached the rows of the codes and the results that I get from using entry price(1) and entryprice(0) in my graph (Dax, 15 minutes timeframe).
I would expect that at the 4th bar of today it should display the entry price of the current open trade, instead using "entryprice" it returns 0 while using entryprice(1) it returns the value of the previous entry... what am I doing wrong?
Many thanks!
Re: Problem with entryprice
EP is a variable to which I try to assign the value of the entryprice (it is declared at the beginning in "Vars: EP(0),...").
I have also already tried to plot directly the "entryprice" without using EP, but it does not work anyway as you can see in the new attached screenshot.
Thank you really very much for your help!
I have also already tried to plot directly the "entryprice" without using EP, but it does not work anyway as you can see in the new attached screenshot.
Thank you really very much for your help!
- Attachments
-
- entryprice1.gif
- (44.14 KiB) Downloaded 692 times
- TJ
- Posts: 7743
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2222 times
Re: Problem with entryprice
EP is a variable to which I try to assign the value of the entryprice (it is declared at the beginning in "Vars: EP(0),...").
I have also already tried to plot directly the "entryprice" without using EP, but it does not work anyway as you can see in the new attached screenshot.
Thank you really very much for your help!
- Attachments
-
- ID.jpg
- (29.87 KiB) Downloaded 740 times
Re: Problem with entryprice [SOLVED]
Hi TJ, I have fixed my problem: the solution was to bring the instruction "Text" out of the "if...end" condition.
EP is working good, it is just a personal variable that I use to store the entryprice for other purposes but I also need to plot on the chart.
Everything is perfect now, thank you very much for your interest and collaboration
EP is working good, it is just a personal variable that I use to store the entryprice for other purposes but I also need to plot on the chart.
Everything is perfect now, thank you very much for your interest and collaboration