Price
Price
24 Jan 2018, 21:12
Good evening, how can I for example have the EURUSD chart and through "ChartObjects.DrawText" have the current USDJPY price indication in the chart ?
Thank you
Replies
DelFonseca
25 Jan 2018, 20:24
RE:
Panagiotis Charalampous said:
Hi DelTrader,
See an example below
using System; (...)Best Regards,
Panagiotis
HI Panagiotis,
Thank you, thank you so much !! You're awesome !! Cheers
@DelFonseca
DelFonseca
25 Jan 2018, 23:04
Helo again,
I have 2 problems now, im trying calculate Bid-Ask to get single result but i cant. And im trying Create if structure but i cant.
The problem with operators '-' and '>', because they cant be apllied in operands of type 'string'.
Can you help me?
The structure:
protected override void OnTick() { var Symbol1MarketData = MarketData.GetSymbol(Symbol1); var Symbol2MarketData = MarketData.GetSymbol(Symbol2); var Symbol3MarketData = MarketData.GetSymbol(Symbol3); var Symbol1Low = MarketSeries.Low.LastValue; var Symbol2Low = MarketSeries.Low.LastValue; var Symbol3Low = MarketSeries.Low.LastValue; var Symbol1Bid = Symbol1MarketData.Bid.ToString(); var Symbol2Bid = Symbol2MarketData.Bid.ToString(); var Symbol3Bid = Symbol3MarketData.Bid.ToString(); var Symbol1Ask = Symbol1MarketData.Ask.ToString(); var Symbol2Ask = Symbol2MarketData.Ask.ToString(); var Symbol3Ask = Symbol3MarketData.Ask.ToString(); var Symbol1Result = Symbol1Bid - Symbol1Ask; var Symbol2Result = Symbol2Bid - Symbol2Ask; var Symbol3Result = Symbol3Bid - Symbol3Ask; if (Symbol1Result > Symbol2Result > Symbol3Result) { ExecuteMarketOrder(TradeType.Buy, Symbol, VolumeInUnits); } }
@DelFonseca
PanagiotisCharalampous
26 Jan 2018, 10:13
Hi DelTrader,
See below a correct way to write this function
protected override void OnTick() { var Symbol1MarketData = MarketData.GetSymbol("EURUSD"); var Symbol2MarketData = MarketData.GetSymbol("USDJPY"); var Symbol3MarketData = MarketData.GetSymbol("EURGBP"); var Symbol1Low = MarketSeries.Low.LastValue; var Symbol2Low = MarketSeries.Low.LastValue; var Symbol3Low = MarketSeries.Low.LastValue; var Symbol1Bid = Symbol1MarketData.Bid; var Symbol2Bid = Symbol2MarketData.Bid; var Symbol3Bid = Symbol3MarketData.Bid; var Symbol1Ask = Symbol1MarketData.Ask; var Symbol2Ask = Symbol2MarketData.Ask; var Symbol3Ask = Symbol3MarketData.Ask; var Symbol1Result = Symbol1Bid - Symbol1Ask; var Symbol2Result = Symbol2Bid - Symbol2Ask; var Symbol3Result = Symbol3Bid - Symbol3Ask; if (Symbol1Result > Symbol2Result && Symbol2Result > Symbol3Result) { ExecuteMarketOrder(TradeType.Buy, Symbol, 1000); } }
Let me know if this helps,
Best Regards,
Panagiotis
@PanagiotisCharalampous
DelFonseca
26 Jan 2018, 19:58
RE:
Panagiotis Charalampous said:
Hi DelTrader,
See below a correct way to write this function
protected override void OnTick() { (...) }Let me know if this helps,
Best Regards,
Panagiotis
Perfect!! You'r the guy !! Thank you so much. Im trying creating Triangular Arbitrage Bot. Thank you so much !!!
@DelFonseca
PanagiotisCharalampous
25 Jan 2018, 12:24
Hi DelTrader,
See an example below
Best Regards,
Panagiotis
@PanagiotisCharalampous