how to add a value in pips in coding
how to add a value in pips in coding
07 Sep 2022, 06:33
Hi community Can anyone help me in this. I am working on a sample bot and here i am stuck at a point. I am new in botting thing and mostly know nothing so i am experimenting for a strategy here
I want that only buy or sell position if the Price is 20 30 40 pips more or less of the reference price.
TradeParameterCalculations("Short","Any");
var ordstop = PlaceStopOrder(TradeType.Sell, SymbolName, _lots, Bars.LowPrices.Last(1), _shortlabel, _sl, _tp);
Now after the Low prices. what bot is doing its actually selling a trade at the previous candle low where as i want to set command that sell 20 pips more lower than the low price of last candle and same in the case of buy positions where i want to buy 20 pips more than the high price..
Please help
Replies
moiz.forex
07 Sep 2022, 17:02
RE:
PanagiotisCharalampous said:
Hi,
You can try something like this
PlaceStopOrder(TradeType.Sell, SymbolName, _lots, Bars.LowPrices.Last(1) - (Symbol.PipSize * 20), _shortlabel, _sl, _tp);
Best Regards,
Panagiotis
Ok so what you added after Last(1) -(Symbol.PipSize *20), the minus or the dash size gives command of less 20 pips and then at the buy side we will do + (Symbol.PipSize*20),
and if i want to change how many pips up and down i want all i can do is to change the 20 number is that rite?
@moiz.forex
PanagiotisCharalampous
08 Sep 2022, 08:29
Hi moiz.forex,
Yes that is correct
Best Regards,
Panagiotis
Join us on Telegram and Facebook
@PanagiotisCharalampous
PanagiotisCharalampous
07 Sep 2022, 08:32
Hi,
You can try something like this
Best Regards,
Panagiotis
Join us on Telegram and Facebook
@PanagiotisCharalampous