how to get the profit for recent trading.

 

Greetings....

In my trading strategy, i'm only allowing a max loss 0f 20% from initial deposit for a specific period, and upon reaching a profit level ..lets say 15%, the trade criteria will follow a new sets of lotsize and other set parameters specific to a higher band and no new trades shall be opened if the Account Balance/Initial deposit falls back to a lower range

Example ..

For a deposit of 1000, trades will only be made if the RatioToTrade which i define as ................

RatioToTrade=AccountBalance()/InitialDeposit; is > 0.8 and < 1.15 (800 to 1150)

The rule to enter trade that im using is

if((Total<1 && RatioToTrade>0.8) && RatioToTrade<=1.15 ) and followed by other instructions......

Once the RatioToTrade goes > 1.15 then the trade parameters for next trade are changed accordingly......

my concern is if the initial trades ends up making profit, the RatioToTrade will increase and thus new trades are operated acording to higher range rules i.e

if (Total<1 && ratioToTrade>1.15). followed by other instructions...

However if the fist trade upon going to higher range ends up as a loss, then i want the system to no longer do trading fo that period ..........but based on my current coding it goes back to the lower range and trading starts if other set indicators permit.

im thinking of introducing another if() rule for this

if((Total<1 && RatioToTrade>0.8) && RatioToTrade<=1,15)
{
if(RatioToTrade<1.15 && PrevRatioToTrade<1.15)

{

foll0wed by other instruction.

the reationale for this is, if a trade is to be activated according to lower range rules...both new RatioToTrade and PrevRatioToTrade must originate from the same range.....

and to do this i need the information for either

1. AccountBalance as at start or previously completed trade

2. The recorded Profit for most recent trade activity..... this be used for computing PrevRatioToTrade....

can someone please help......really appreciate it.

and sorry for the long explanation.....

 
jayakaa:

can someone please help......really appreciate it.

and sorry for the long explanation.....

I'm not sure what your question is ?
 
jayakaa:

Greetings....

In my trading strategy, i'm only allowing a max loss 0f 20% from initial deposit for a specific period, and upon reaching a profit level ..lets say 15%, the trade criteria will follow a new sets of lotsize and other set parameters specific to a higher band and no new trades shall be opened if the Account Balance/Initial deposit falls back to a lower range

Example ..

For a deposit of 1000, trades will only be made if the RatioToTrade which i define as ................

RatioToTrade=AccountBalance()/InitialDeposit; is > 0.8 and < 1.15 (800 to 1150)

The rule to enter trade that im using is

if((Total<1 && RatioToTrade>0.8) && RatioToTrade<=1.15 ) and followed by other instructions......

Once the RatioToTrade goes > 1.15 then the trade parameters for next trade are changed accordingly......

my concern is if the initial trades ends up making profit, the RatioToTrade will increase and thus new trades are operated acording to higher range rules i.e

if (Total<1 && ratioToTrade>1.15). followed by other instructions...

However if the fist trade upon going to higher range ends up as a loss, then i want the system to no longer do trading fo that period ..........but based on my current coding it goes back to the lower range and trading starts if other set indicators permit.

im thinking of introducing another if() rule for this

if((Total<1 && RatioToTrade>0.8) && RatioToTrade<=1,15)
{
if(RatioToTrade<1.15 && PrevRatioToTrade<1.15)

{

foll0wed by other instruction.

the reationale for this is, if a trade is to be activated according to lower range rules...both new RatioToTrade and PrevRatioToTrade must originate from the same range.....

and to do this i need the information for either

1. AccountBalance as at start or previously completed trade

2. The recorded Profit for most recent trade activity..... this be used for computing PrevRatioToTrade....

can someone please help......really appreciate it.

and sorry for the long explanation.....

Hi Jayakaa,

1. I assume that Total = OrdersTotal(), am I correct ?.


2. Like RaptorUK, I also not sure what your question is. So I have to assume, whatever, how about these

if (Total < 1)
  {
   //---
   if(RatioToTrade>0.8 && RatioToTrade<=1.15) // if we use lower parameter 
     { 
     if(PrevRatioToTrade > 1.15)    // ... we check if last one is higher ...
       {
       // ... if it is higher we use this set
       {
       else
       {
       if(PrevRatioToTrade <= 0.08)  // ... or even lower ...
         {
         // ... if it is lower we use this set 
         {
         else  // this mean last_ratio is between > 0.08 and <= 1.15                       
         {
         // ... if not all we use this set
         }
     }
     
   //---  
   if(ratioToTrade>1.15 && ....   )           // if we use higher parameter 
     {
     // .... lol, bla, btw, etc, etc       
     }  
     
   //---
   PrevRatioToTrade = ratioToTrade;           // ...then we record the value  
  }

I may be wrong though

:D

 
onewithzachy:

Hi Jayakaa,

1. I assume that Total = OrdersTotal(), am I correct ?.


2. Like RaptorUK, I also not sure what your question is. So I have to assume, whatever, how about these

I may be wrong though

:D

Guys.....my apologies for writing a very confusing statement and missing out on the question..... anyway what onewithzachy has written is pretty much what i intended.....Thanks a lot...

rephrasing it......

1. i'm using the RatioToTrade (AccountBalance/InitialDeposit) value as the guide for entering future trade... the initial value is obviously 1...

2. i have 2 sets of trading rules to follow..

i) in the case of RatioToTrade valued between 0.8 to 1.15 ....the 1st set of trading rules will be used ....... and hopefully the index increases resulting from profitable outcomes. in the event of losing trades the index decrease and if it goes below 0.8, i will not continue trading for a while (rarely happens).

ii) Once the RatioToTrade goes above 1.15, i'd like to apply 2nd set of trading rules..... and again hopefully the index continues to grow. Irrespective of future (profit/loss) outcome trades, if the index remain above 1.15 the 2nd set will be applied.


3. if a string of continous losing trades in future results in the RatioToTrade falling back into the 0.8 ~ 1.15 range ....the 1st set will be applied. However this is what i want to avoid. If this happens i want to lock in the profit ~1.5% and start the whole thing again.

so im trying to use the PrevRatioToTrade (the previous value before last trade commenced)..in the If() argument....

using ... onewithzachy's suggestion....

if (Total < 1)
{

if(RatioToTrade>0.8 && PrevRatioToTrade<=1.15) // note: i think the system will take that in the beginning, RatioToTrade=1 and PrevRatioToTrade=1 ..... (no 0th trade)
{
// ...followed by 1st set of Trading rule...


i just don't know how to get the PrevRatioToTrade value as both AccountBalance() and OrderProfit() gives latest values only ...that is why the topic is titled profit for recent trading......

guys....i'm sorry for writing such long remarks again ...just want to make sure i get the message across....perhaps this requires only a simple solution but being a newbie im unsure but definately eager to learn.

i value your comments....

Thank you

Reason: