Topics
22 Nov 2017, 03:55
 2695
 5
06 Nov 2017, 08:50
 1406
 3
Replies

khan_tu
22 Nov 2017, 20:51

RE:

Panagiotis Charalampous said:

Hi khan_tu,

Can you please give us some more information why you say that your algorithm is "currently not doing so"? Is it because it stops executing for any reason? A code sample of a complete cBot would be more helpful to understand what could go wrong.

Best Regards,

Panagiotis

The Problem Seems to be that its not running through the entire nested if statement, it runs through one or two, but doesnt read all of them

it enters positions it shouldnt because one conditin was true but the others werent for some reason


@khan_tu

khan_tu
06 Nov 2017, 09:28

 

if (rsi.Result.LastValue <= 30)
                {
                    if (direction != 0)
                    {
                        foreach (var pos in Positions)
                        {
                            ClosePosition(pos);
                        }
                        PlaceLimitOrder(TradeType.Buy, Symbol, 10000, Symbol.Bid);
                        //  ExecuteMarketOrder(TradeType.Buy, Symbol, Quantity);

                        //  Close(TradeType.Sell);
                        direction = 0;
}
}

 if (rsi.Result.LastValue >= 70)
                {
                    if (direction != 1)
                    {
                        foreach (var Position in Positions)
                        {
                            ClosePosition(Position);
                        }
                        //Open(TradeType.Sell);
                        //Close(TradeType.Buy);
                        ExecuteMarketOrder(TradeType.Sell, Symbol, 10000);
                        //ClosePosition(Position);
                        direction = 1;
                    }
                }

 


@khan_tu

khan_tu
05 Nov 2017, 23:43

im thinking itd be easier just to manually put in the logic needed for the indicator and going from there instead of importing it


@khan_tu

khan_tu
05 Nov 2017, 23:40 ( Updated at: 21 Dec 2023, 09:20 )

what i mean is that it doesnt show up in the reference manager


@khan_tu

khan_tu
03 Nov 2017, 19:19

Thank you

I seem to be having another problem, the indicator doesnt show up in the list of custom indicators

i can overlay it on a graph and i can call it when programming but i cant reference it in the indicators page of reference manager


@khan_tu