Indicator Buffers other than double (e.g. struct)

 

Hello,

I want to create an indicator which tells me when to enter a trade. Additionaly the indicator tells me:

  • Now! enter Trade
  • StopLoss value
  • TakeProfit value

How can I pass this information from the indicator to my expert?

Do I have to use three different Index Buffers for this, or can I use some other method?

I tried it with a struct, but I have no idea how to pass this Array to my expert.

struct trade_settings
  {
   bool     newTrade;      
   double   StopLoss;      
   double   TakeProfit;         
  };

trade_settings scTradeInfoBuffer[];

SetIndexBuffer(7,scTradeBuffer,INDICATOR_DATA);     //--> Error: of course, because just double is allowed!?

I hope for some enlightenment.

 
You need 3 index buffers. I don't think there's another way to do it. You could spare the Now! buffer if you set the TP buffer to EMPTY_VALUE where a trade signal is absent.
 
lippmaje:
You need 3 index buffers. I don't think there's another way to do it. You could spare the Now! buffer if you set the TP buffer to EMPTY_VALUE where a trade signal is absent.

thank you for clarification!

Regards,

Thomas