Page 1 of 1

Moving stop loss to x pips away from previous HA bar

PostPosted: Fri Mar 03, 2017 4:41 pm
by nanobyt3
Hi all, :)

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;"Moving Stop Loss Higher to ".. tostring(iHA.low[period]-PBT));

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