Login Page - Create Account

Support Board


Date/Time: Wed, 24 Apr 2024 19:08:36 +0000



[Programming Help] - adding a 3rd MA for a crossover

View Count: 749

[2018-07-01 19:17:22]
User61576 - Posts: 418
Pls advice how can I add a 3rd MA to the simple 2 MA crossover example provided by SC.
I added the "(line2 >= line3)" but got an error:

C:\SierraChart\ACS_Source>call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
3xMA_crossoverr_trading_system.cpp
C:\SierraChart\ACS_Source\3xMA_crossoverr_trading_system.cpp(134): error C2678: binary '>=': no operator found which takes a left-hand operand of type 'SCFloatArray' (or there is no acceptable conversion)
c:\sierrachart\acs_source\scdatetime.h(2241): note: could be 'bool operator >=(double,const SCDateTime &)'
c:\sierrachart\acs_source\scdatetime.h(2202): note: or 'bool operator >=(int,const SCDateTime &)'
C:\SierraChart\ACS_Source\3xMA_crossoverr_trading_system.cpp(134): note: while trying to match the argument list '(SCFloatArray, SCFloatArray)'
C:\SierraChart\ACS_Source\3xMA_crossoverr_trading_system.cpp(148): error C2065: 'Line2': undeclared identifier
-- End of Build -- 22:14:47

if (sc.CrossOver(line1, line2) == CROSS_FROM_BOTTOM &&
    (line2 >= line3))
{
// mark the crossover on the chart
bullish[sc.Index] = 1;

// Create a market order and enter long.
s_SCNewOrder order;
order.OrderQuantity = 1;
order.OrderType = SCT_ORDERTYPE_MARKET;

sc.BuyEntry(order);
}

btw, I think it will be grate to have a separate forum for programming issues. thanks for helping
[2018-07-05 19:10:27]
User61576 - Posts: 418
pls advice
thanks
[2018-07-13 11:46:43]
User61576 - Posts: 418
????????

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account