RSI bot question

Created at 02 Jun 2013, 11:44
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
PA

Paladynn

Joined 02.06.2013

RSI bot question
02 Jun 2013, 11:44


I have a plan for an RSI based robot.

I was trying to get it to print to the log what values it recives so I can integtrate the decision tree I have for setting up trades.

I made a testing addition to the rsi sample bot code:

 

   protected override void OnTick()
        {
            if (Trade.IsExecuting) return;


            if (rsi.Result.LastValue < 30)
            {
                OpenPosition(TradeType.Buy);
                    Print ("Buy {00}",rsi.Result.LastValue);
            }
            else if(rsi.Result.LastValue > 70)
            {
                OpenPosition(TradeType.Sell);
                Print ("Sell {00}",rsi.Result.LastValue);
            }
        }

 

When i got the results log all i saw was 

(Datetime)  Sell 100

(DatetimeBuy 0

I am a little stumped, How do i get the decimal number I see charted when it's in an EA?

I have tried several methods and got NaN for my troubles.

Any ideas?

 

Thanks for the info

Gary

 

 

 

 


@Paladynn
Replies

cAlgo_Fanatic
04 Jun 2013, 11:10

Are you using period = 1 for the RSI?

You can look at the code for the RSI here to better understand the results.




@cAlgo_Fanatic

Paladynn
05 Jun 2013, 10:33

RE:
cAlgo_Fanatic said:

Are you using period = 1 for the RSI?

You can look at the code for the RSI here to better understand the results.



this one uses the default value of 14 from the sample RSI bot included in calgo.

 


@Paladynn

cAlgo_Fanatic
05 Jun 2013, 10:42

Can you please send us your code to engage@spotware.com. 


@cAlgo_Fanatic