I have been developing a strategy in lua for FXCM Trading Station and I'm having problems moving a stop loss to few pips (customizable) away from a previous HeikenAshi bar. I have the following:
- Code: Select all
--Trailing the SL to x PBT pips from the previous bar
if haveTrades("B") then
valuemap.PegTypeStop = "O";
valuemap.PegPriceOffsetPipsStop = iHA.low[period]-PBT;
core.host:trace("Moving Stop Loss Higher to ".. tostring(iHA.low[period]-PBT));
end
PBT is the variable with the number of PIPs away from the low as in this case. the log shows me big number when trying to add the iHA.low[period]+PBT. This number does not seem to be related to price.
Any good link for me to learn how to move the Stop Loss to whatever position I need?
Thank you very much