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

jaffer wilson
3802

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.

Grzegorz Pawlak
417
Grzegorz Pawlak  
Hi, did you checked journal in platform?. Regards Greg
jaffer wilson
3802
jaffer wilson  
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?

Grzegorz Pawlak
417
Grzegorz Pawlak  
you will see change stop loss position.
amando
3686
amando  
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

Vladimir Karputov
Moderator
271100
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
jaffer wilson
3802
jaffer wilson  
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.

jaffer wilson
3802
jaffer wilson  
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.

Vladimir Karputov
Moderator
271100
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.

jaffer wilson
3802
jaffer wilson  
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".

Chris70
544
Chris70  
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.