For my EA i want to read out a specific value from an indicator. For my case, i want to read out the int "changeofTrend" from the super-trend indicator. So whenever "changeofTrend ==1" occurs or is true, i want to the close the last order! The super-trend indicator i use is in the attachement.
Here you find my code for closing buy and sell positions:
I would be very thankful for a hint or advice !
i just checked the return values from and got it right right now, without using changeofTrend.
if(1 ==0) is just a there to let the EA execute without sending an error. Its just a spaceholder for a closing condition which can be set by the programmer. Thats why its said above"replace 1==0 to your conditions". Below you see my condition which works well.
I would like to ask another question. Whats the correct function to call up the current market price ? i havent found an example till now. My idea is, that i want to code a buystop and sellstop condition. THe buystop condition is fulfilled when the market price moves below the supertrend value (in Uptrend) and a sellstop when the market price moves above the supertrend value (in downtrend). I tried it with MarketInfo() with the bid and ask values but they dont return the right values.
I would be very thankful for an idea.