How to get the previous Stop Loss of the opened position?

 

I have opened a position with no stop loss. Then using the trailing I am setting the Stop Loss of the Positions.

But the trailing sets multiple stop loss as the condition is met.

I want to know whether there is possibility to check the previous stop loss of the opened position or not? If yes then how I can do that. Please let me know.

 
Hi, did you checked journal in platform?. Regards Greg
 
Greg Pawlak:
Hi, did you checked journal in platform?. Regards Greg

I am taking in context with the MQL5 programming . What I will do looking at the journal of the platform? Will that help me?

 
you will see change stop loss position.
 
Greg Pawlak:
you will see change stop loss position.

You can follow the position over the history with order history or deal history.

select it by your position id and filter copy the highest or lowast value to a variable

 
jaffer wilson :

I have opened a position with no stop loss . Then using the trailing I am setting the Stop Loss of the Positions.

But the trailing sets multiple stop loss as the condition is met.

I want to know whether there is possibility to check the previous stop loss of the opened position or not? If yes then how I can do that. Please let me know.

The CPositionInfo class provides all the information.

In your case you need to use CPositionInfo:StopLoss.

Documentation on MQL5: Standard Library / Trade Classes / CPositionInfo
Documentation on MQL5: Standard Library / Trade Classes / CPositionInfo
  • www.mql5.com
Standard Library / Trade Classes / CPositionInfo - Reference on algorithmic/automated trading language for MetaTrader 5
 
Vladimir Karputov:

The CPositionInfo class provides all the information.

In your case you need to use CPositionInfo:StopLoss.

 I know the library. I am using it as well. But it gives the information of the current values of the Stop Loss and not the previous or previous to previous. Please let me know about that.

 
amando:

You can follow the position over the history with order history or deal history.

select it by your position id and filter copy the highest or lowast value to a variable

History is for the closed not opened positions I guess.

 
jaffer wilson :

 I know the library. I am using it as well. But it gives the information of the current values of the Stop Loss and not the previous or previous to previous. Please let me know about that.

Modifications of StopLoss and TakeProfit levels are NOT SAVED IN TRADING HISTORY. This has been reported to you more than once.

 
Vladimir Karputov:

Modifications of StopLoss and TakeProfit levels are NOT SAVED IN TRADING HISTORY. This has been reported to you more than once.

Respected moderator, I do not mean o offend you or any other here. But what you have mentioned in the previous message to me is what mentioned for the first time. " NOT SAVED IN TRADING HISTORY"

If this is what is there then I take leave from this thread of forum. And thank you for the help.

But no one mentioned anything like this before to me ever and you say " reported to you more than once".

 
Vladimir Karputov:

Modifications of StopLoss and TakeProfit levels are NOT SAVED IN TRADING HISTORY. This has been reported to you more than once.

Even if you don't find the necessary information in the deal history, it should't be a big deal to make the EA keep track of the stop loss history by itself and store it in an array and/or save it permanently in a file.