I would like to trigger an email alert on trade entries and exits which includes the price at which my trade was filled at.
I am using the following in my easy language code: (triggered after my entry conditions are met)
alert(text("Long Entry at:", Entryprice_checked));
What is the difference between Entryprice, Entryprice_checked, PosTradeEntryPrice?
Additionally I was wondering if someone knew what the "Price:" field in default alert messages is reporting?
(The alert() triggered email comes with a few fields that are fixed and always included: Source, Instrument, Resolution, Price, Message)
thanks
Florian
Sending Email Alerts with Entry Price
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: Sending Email Alerts with Entry Price
Hello Florian,
EntryPrice - Returns the price of the initial entry into the specified position.
With PosTradeEntryPrice you can get the price not only of the initial entry, but of the other trades of the specified position as well.
EntryPrice_Checked will generate an error if PosBack value is greater that the real number of previously opened positions, while EntryPrice will not do that.
EntryPrice - Returns the price of the initial entry into the specified position.
With PosTradeEntryPrice you can get the price not only of the initial entry, but of the other trades of the specified position as well.
EntryPrice_Checked will generate an error if PosBack value is greater that the real number of previously opened positions, while EntryPrice will not do that.
This is the chart close price at the moment of alert generation.Additionally I was wondering if someone knew what the "Price:" field in default alert messages is reporting?
-
- Posts: 199
- Joined: 25 Jan 2008
- Has thanked: 2 times
- Been thanked: 7 times
Re: Sending Email Alerts with Entry Price
I have been working on getting emails sent. I am doing something wrong and need help!
1. When an order is placed.
or
2. When a trade is filled.
and when a profit target has been reached.
I am closer but still not there. I am first focusing on when a trade fills.
My strategies will take on more than one trade in a position.
The only reference I am making to alerts, is in
protect override void CalcBar(), which contains various conditions as it relates to time and date, at the end my send code.
To the above, I added
Alerts.Alert("Long Entry", PosTradeEntryPrice);
The way I have it applied, I find Alerts.Alert("Long Entry", PosTradeExitPrice);
to provide identical results.
I have used it in place of PosTradeEntryPrice
I have used it on another line, following PosTradeEntryPrice
I have tried it in a separate strategy, profit target.
I get 2 emails with each filled signal, one for each of PosTradeEntryPrice and PosTradeExitPrice
An example of how this should be coded would be really appreciated.
Thank you!! DB
1. When an order is placed.
or
2. When a trade is filled.
and when a profit target has been reached.
I am closer but still not there. I am first focusing on when a trade fills.
My strategies will take on more than one trade in a position.
The only reference I am making to alerts, is in
protect override void CalcBar(), which contains various conditions as it relates to time and date, at the end my send code.
To the above, I added
Alerts.Alert("Long Entry", PosTradeEntryPrice);
The way I have it applied, I find Alerts.Alert("Long Entry", PosTradeExitPrice);
to provide identical results.
I have used it in place of PosTradeEntryPrice
I have used it on another line, following PosTradeEntryPrice
I have tried it in a separate strategy, profit target.
I get 2 emails with each filled signal, one for each of PosTradeEntryPrice and PosTradeExitPrice
An example of how this should be coded would be really appreciated.
Thank you!! DB
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: Sending Email Alerts with Entry Price
That is possible to generate an alert only after the actual position for the instrument changes.
Please check OnBrokerPositionChange, OnBrokerStategyOrderFilled
Please check OnBrokerPositionChange, OnBrokerStategyOrderFilled
-
- Posts: 199
- Joined: 25 Jan 2008
- Has thanked: 2 times
- Been thanked: 7 times
Re: Sending Email Alerts with Entry Price
Henry,
I find little reference material on those. Are there any examples of their use?
Thank you,
Don
I find little reference material on those. Are there any examples of their use?
Thank you,
Don
- JoshM
- Posts: 2195
- Joined: 20 May 2011
- Location: The Netherlands
- Has thanked: 1544 times
- Been thanked: 1565 times
- Contact:
Re: Sending Email Alerts with Entry Price
Which MultiCharts version do you use?(...)
The only reference I am making to alerts, is in
protect override void CalcBar(), which contains various conditions as it relates to time and date, at the end my send code.
To the above, I added
Alerts.Alert("Long Entry", PosTradeEntryPrice);
The way I have it applied, I find Alerts.Alert("Long Entry", PosTradeExitPrice);
(...)
I'm asking since `PosTradeExitPrice` and `PosTradeEntryPrice` are MultiCharts PowerLanguage reserved words, while the `Alerts.Alert()` method only exists in MultiCharts .NET. You seem to combine these two in the same programming code.
Or did you create variables in MultiCharts .NET with the exact same name as MultiCharts PowerLanguage reserved words?
-
- Posts: 199
- Joined: 25 Jan 2008
- Has thanked: 2 times
- Been thanked: 7 times
Re: Sending Email Alerts with Entry Price
Josh,
At this time, I am running both versions. I made the mistake of posting to the wrong forum. I would prefer to get it done in Net, but will work with PL. Appreciate any help!
DB
At this time, I am running both versions. I made the mistake of posting to the wrong forum. I would prefer to get it done in Net, but will work with PL. Appreciate any help!
DB
-
- Posts: 199
- Joined: 25 Jan 2008
- Has thanked: 2 times
- Been thanked: 7 times
Re: Sending Email Alerts with Entry Price
I should have mentioned....
That which I showed in my code example, is from an earlier part of this thread. I saw it here asked a question about it and here we are.
thanks
That which I showed in my code example, is from an earlier part of this thread. I saw it here asked a question about it and here we are.
thanks
-
- Posts: 199
- Joined: 25 Jan 2008
- Has thanked: 2 times
- Been thanked: 7 times