Search code examples
luatradingforex

Indicore SDK Strategy Development - How to draw simple dots on a chart?


I am trying to develop a simple Indicore SDK strategy (for FXCM Marketscope 2.0) with LuaEditor and I have a simple question. The Indicore SDK documentation is very poor and devoid of context and examples, so I can't figure out how to print a simple dot on the screen under a price bar. Basically what I am trying to do is show where my custom stop loss is under the price bar.

In indicator development, elements can be drawn by creating output streams (instance:addStream) in the Prepare function. Unfortunately, output streams don't seem to be a part of strategy development and give the runtime error "attempt to call 'addStream' (a nil value)" when I try to run it in Lua Strategy Debugger.

So in the ExtUpdate() function, how do you draw a simple dot under the closing price minus 10 pips?

    function ExtUpdate(id, source, period)
       if period > first and source:hasData(period) then 
          --HOW DO YOU DRAW A DOT HERE???
       end
    end

Solution

  • Strategies are not allowed to draw, only indicators can do it. Indicore 3.0 indicators now can trade, so you write an indicator and add all the trading functionality into it.